From b02e45dbb6bdc4c7abb992fafbcd48862328f1ed Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 2 Jan 2018 11:06:04 -0600 Subject: [PATCH] Change the api test to call pirep api --- tests/ApiTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 613c866f..bd4e0bc3 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -20,9 +20,9 @@ class ApiTest extends TestCase public function testApiAuthentication() { $user = factory(User::class)->create(); - $airport = factory(App\Models\Airport::class)->create(); + $pirep = factory(App\Models\Pirep::class)->create(); - $uri = '/api/airports/' . $airport->icao; + $uri = '/api/pireps/' . $pirep->id; // Missing auth header $this->get($uri)->assertStatus(401); @@ -37,19 +37,19 @@ class ApiTest extends TestCase // Test upper/lower case of Authorization header, etc $this->withHeaders($this->apiHeaders())->get($uri) ->assertStatus(200) - ->assertJson(['icao' => $airport->icao], true); + ->assertJson(['id' => $pirep->id], true); $this->withHeaders(['x-api-key' => $user->api_key])->get($uri) ->assertStatus(200) - ->assertJson(['icao' => $airport->icao], true); + ->assertJson(['id' => $pirep->id], true); $this->withHeaders(['x-API-key' => $user->api_key])->get($uri) ->assertStatus(200) - ->assertJson(['icao' => $airport->icao], true); + ->assertJson(['id' => $pirep->id], true); $this->withHeaders(['X-API-KEY' => $user->api_key])->get($uri) ->assertStatus(200) - ->assertJson(['icao' => $airport->icao], true); + ->assertJson(['id' => $pirep->id], true); } /**