mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Add index test
This commit is contained in:
parent
a071fff954
commit
86f13a9735
|
@ -53,4 +53,18 @@ class IndexAccessoryTest extends TestCase implements TestsFullMultipleCompaniesS
|
|||
->assertResponseContainsInRows($accessoryB)
|
||||
->assertResponseContainsInRows($accessoryC);
|
||||
}
|
||||
|
||||
public function testCanGetAccessories()
|
||||
{
|
||||
$user = User::factory()->viewAccessories()->create();
|
||||
|
||||
$accessoryA = Accessory::factory()->create(['name' => 'Accessory A']);
|
||||
$accessoryB = Accessory::factory()->create(['name' => 'Accessory B']);
|
||||
|
||||
$this->actingAsForApi($user)
|
||||
->getJson(route('api.accessories.index'))
|
||||
->assertOk()
|
||||
->assertResponseContainsInRows($accessoryA)
|
||||
->assertResponseContainsInRows($accessoryB);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue