@@ -78,6 +78,16 @@ test('filters routes by company, from, and to', function () {
|
||||
->assertJsonPath('data.0.id', $matching->id);
|
||||
});
|
||||
|
||||
test('paginates routes', function () {
|
||||
EvRoute::factory()->count(20)->create(['is_active' => true]);
|
||||
|
||||
$this->withHeader('Authorization', "Bearer {$this->token}")
|
||||
->getJson('/api/v1/routes')
|
||||
->assertSuccessful()
|
||||
->assertJsonCount(15, 'data')
|
||||
->assertJsonPath('meta.total', 20);
|
||||
});
|
||||
|
||||
test('shows a single active route', function () {
|
||||
$route = EvRoute::factory()->create(['is_active' => true]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user