Convert flight transformer to the native Laravel resource object

This commit is contained in:
Nabeel Shahzad
2017-12-12 07:25:11 -06:00
parent 2e1c0a75d4
commit 373f45c86c
9 changed files with 76 additions and 87 deletions

View File

@@ -24,7 +24,24 @@ class FlightTest extends TestCase
public function testGetFlight()
{
$flight_id = $this->addFlight();
$this->get('/api/flight/'.$flight_id, self::$auth_headers)
->assertStatus(200);
$this->get('/api/flights/'.$flight_id, self::$auth_headers)
->assertStatus(200)
->assertJson(['dpt_airport_id' => 'KAUS']);
$this->get('/api/flights/INVALID', self::$auth_headers)
->assertStatus(404);
}
/**
* Search based on all different criteria
*/
public function testSearchFlight()
{
$flight_id = $this->addFlight();
# search specifically for a flight ID
$query = 'flight_id='.$flight_id;
$req = $this->get('/api/flights/search?' . $query, self::$auth_headers);
$req->assertStatus(200);
}
}