Search for ICAO not working properly (#496)

This commit is contained in:
Nabeel S
2020-01-10 09:41:32 -05:00
committed by GitHub
parent 4844692bd9
commit 03284959d6
7 changed files with 44 additions and 13 deletions

View File

@@ -342,6 +342,26 @@ class FlightTest extends TestCase
$this->assertEquals($flight->id, $body['data'][0]['id']);
}
public function testFlightSearchApiDepartureAirport()
{
$this->user = factory(App\Models\User::class)->create();
factory(App\Models\Flight::class, 10)->create([
'airline_id' => $this->user->airline_id,
]);
$flight = factory(App\Models\Flight::class)->create([
'airline_id' => $this->user->airline_id,
'dpt_airport_id' => 'KAUS',
]);
$query = 'dpt_airport_id=kaus';
$req = $this->get('/api/flights/search?'.$query);
$body = $req->json();
$this->assertCount(1, $body['data']);
$this->assertEquals($flight->id, $body['data'][0]['id']);
}
public function testFlightSearchApiDistance()
{
$total_flights = 10;