mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added API test, renamed test to match filter
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
7b151cf692
commit
157801242d
|
@ -9,7 +9,7 @@ use Tests\Concerns\TestsFullMultipleCompaniesSupport;
|
||||||
use Tests\Concerns\TestsPermissionsRequirement;
|
use Tests\Concerns\TestsPermissionsRequirement;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class DeleteComponentsTest extends TestCase implements TestsFullMultipleCompaniesSupport, TestsPermissionsRequirement
|
class DeleteComponentTest extends TestCase implements TestsFullMultipleCompaniesSupport, TestsPermissionsRequirement
|
||||||
{
|
{
|
||||||
public function testRequiresPermission()
|
public function testRequiresPermission()
|
||||||
{
|
{
|
||||||
|
@ -63,4 +63,13 @@ class DeleteComponentsTest extends TestCase implements TestsFullMultipleCompanie
|
||||||
|
|
||||||
$this->assertSoftDeleted($component);
|
$this->assertSoftDeleted($component);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testCannotDeleteComponentIfCheckedOut()
|
||||||
|
{
|
||||||
|
$component = Component::factory()->checkedOutToAsset()->create();
|
||||||
|
|
||||||
|
$this->actingAsForApi(User::factory()->deleteComponents()->create())
|
||||||
|
->deleteJson(route('api.components.destroy', $component))
|
||||||
|
->assertStatusMessageIs('error');
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue