Try to fix tests
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
74f8cb5298
commit
4aeba2a96b
1 changed files with 5 additions and 8 deletions
|
@ -10,25 +10,22 @@ class AuditAssetTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testPermissionRequiredToCreateAssetModel()
|
public function testPermissionRequiredToCreateAssetModel()
|
||||||
{
|
{
|
||||||
$asset = Asset::factory()->create();
|
|
||||||
$this->actingAs(User::factory()->create())
|
$this->actingAs(User::factory()->create())
|
||||||
->get(route('clone/hardware', $asset))
|
->get(route('clone/hardware', Asset::factory()->create()))
|
||||||
->assertForbidden();
|
->assertForbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPageCanBeAccessed(): void
|
public function testPageCanBeAccessed(): void
|
||||||
{
|
{
|
||||||
$asset = Asset::factory()->create();
|
$this->actingAs(User::factory()->auditAssets()->create())
|
||||||
$response = $this->actingAs(User::factory()->auditAssets()->create())
|
->get(route('asset.audit.create', Asset::factory()->create()))
|
||||||
->get(route('asset.audit.create', $asset));
|
->assertStatus(200);
|
||||||
$response->assertStatus(200);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAssetCanBeAudited()
|
public function testAssetCanBeAudited()
|
||||||
{
|
{
|
||||||
$asset = Asset::factory()->create(['name'=>'Asset to clone']);
|
|
||||||
$this->actingAs(User::factory()->auditAssets()->create())
|
$this->actingAs(User::factory()->auditAssets()->create())
|
||||||
->post(route('asset.audit.store', $asset))
|
->post(route('asset.audit.store', Asset::factory()->create()))
|
||||||
->assertStatus(302)
|
->assertStatus(302)
|
||||||
->assertRedirect(route('assets.audit.due'));
|
->assertRedirect(route('assets.audit.due'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue