5 char ICAO support #1052 (#1198)

This commit is contained in:
Nabeel S
2021-05-21 10:52:47 -04:00
committed by GitHub
parent ede5b74383
commit d3ec0f4de3
4 changed files with 45 additions and 4 deletions

View File

@@ -166,6 +166,24 @@ class ApiTest extends TestCase
$this->get('/api/airports/UNK')->assertStatus(404);
}
/**
* Make sure the airport data is returned
*/
public function testAirportRequest5Char()
{
$this->user = factory(User::class)->create();
/** @var Airport $airport */
$airport = factory(Airport::class)->create(['icao' => '5Char']);
$response = $this->get('/api/airports/'.$airport->icao);
$response->assertStatus(200);
$response->assertJson(['data' => ['icao' => $airport->icao]]);
$this->get('/api/airports/UNK')->assertStatus(404);
}
/**
* Get all the airports, test the pagination
*/