mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
Added new test
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
17a6a871ae
commit
41a6b34768
|
@ -28,7 +28,7 @@ class LocationsViewTest extends TestCase
|
|||
public function testViewingLocationAssetIndex()
|
||||
{
|
||||
$location = Location::factory()->create();
|
||||
Asset::factory()->count(3)->assignedToLocation($location)->create();
|
||||
Asset::factory()->count(3)->create(['location_id' => $location->id]);
|
||||
|
||||
$this->actingAsForApi(User::factory()->superuser()->create())
|
||||
->getJson(route('api.locations.viewassets', $location->id))
|
||||
|
@ -41,4 +41,21 @@ class LocationsViewTest extends TestCase
|
|||
'total' => 3,
|
||||
]);
|
||||
}
|
||||
|
||||
public function testViewingAssignedLocationAssetIndex()
|
||||
{
|
||||
$location = Location::factory()->create();
|
||||
Asset::factory()->count(3)->assignedToLocation($location)->create();
|
||||
|
||||
$this->actingAsForApi(User::factory()->superuser()->create())
|
||||
->getJson(route('api.locations.assigned_assets', $location->id))
|
||||
->assertOk()
|
||||
->assertJsonStructure([
|
||||
'total',
|
||||
'rows',
|
||||
])
|
||||
->assertJson([
|
||||
'total' => 3,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue