mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added test
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
50c88df4cc
commit
7b151cf692
|
@ -40,6 +40,18 @@ class DeleteComponentTest extends TestCase implements TestsFullMultipleCompanies
|
|||
$this->assertSoftDeleted($component);
|
||||
}
|
||||
|
||||
public function testCannotDeleteComponentIfCheckedOut()
|
||||
{
|
||||
$component = Component::factory()->checkedOutToAsset()->create();
|
||||
|
||||
$this->actingAs(User::factory()->deleteComponents()->create())
|
||||
->delete(route('components.destroy', $component->id))
|
||||
->assertSessionHas('error')
|
||||
->assertRedirect(route('components.index'));
|
||||
|
||||
$this->assertSoftDeleted($component);
|
||||
}
|
||||
|
||||
public function testDeletingComponentRemovesComponentImage()
|
||||
{
|
||||
Storage::fake('public');
|
||||
|
|
Loading…
Reference in a new issue