@@ -4,9 +4,6 @@ namespace Tests;
|
||||
|
||||
use App\Models\Airport;
|
||||
|
||||
/**
|
||||
* Test the parsing/support class of the metar
|
||||
*/
|
||||
class AirportTest extends TestCase
|
||||
{
|
||||
public function testSavingAirportFromApiResponse()
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user