diff --git a/tests/Feature/ApplicationTest.php b/tests/Feature/ApiTest.php similarity index 100% rename from tests/Feature/ApplicationTest.php rename to tests/Feature/ApiTest.php diff --git a/tests/Feature/SiswaTest.php b/tests/Feature/SiswaTest.php deleted file mode 100644 index 6f126d3..0000000 --- a/tests/Feature/SiswaTest.php +++ /dev/null @@ -1,48 +0,0 @@ -json('POST', '/api/siswa', ['nama' => 'Sally', 'nisn' => '1234567890']); - - $response - ->assertStatus(404) - ->assertJson([ - 'siswa' => 'Siswa tidak ditemukan.' - ]); - } - - public function testCariDataSiswaBerhasil() - { - $siswa = \App\Siswa::create([ - 'nama' => 'Sally', - 'nisn' => '1234567890', - 'kelas' => 'xii mm 1', - 'tempat_lahir' => $this->faker->city(), - 'tanggal_lahir' => $this->faker->dateTime('now', 'Asia/Jakarta'), - 'lulus' => true, - ]); - - $response = $this->json('POST', '/api/siswa', ['nama' => 'Sally', 'nisn' => '1234567890']); - - $response - ->assertStatus(200) - ->assertJson([ - 'nama' => $siswa->nama, - 'nisn' => $siswa->nisn, - 'kelas' => $siswa->kelas, - 'tempat_lahir' => $siswa->tempat_lahir, - 'tanggal_lahir' => $siswa->tanggal_lahir->toDateString(), - 'lulus' => true, - ]); - } -}