mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Added test
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
06737f45ad
commit
61f76dedc6
|
@ -25,7 +25,7 @@ class DeleteUserTest extends TestCase
|
|||
|
||||
public function testErrorReturnedViaApiIfUserDoesNotExist()
|
||||
{
|
||||
$this->actingAsForApi(User::factory()->deleteUsers()->create(['company_id'=> null]))
|
||||
$this->actingAsForApi(User::factory()->deleteUsers()->create())
|
||||
->deleteJson(route('api.users.destroy', 'invalid-id'))
|
||||
->assertOk()
|
||||
->assertStatus(200)
|
||||
|
@ -33,6 +33,17 @@ class DeleteUserTest extends TestCase
|
|||
->json();
|
||||
}
|
||||
|
||||
public function testErrorReturnedViaApiIfUserIsAlreadyDeleted()
|
||||
{
|
||||
$user = User::factory()->deletedUser()->create();
|
||||
$this->actingAsForApi(User::factory()->deleteUsers()->create())
|
||||
->deleteJson(route('api.users.destroy', $user->id))
|
||||
->assertOk()
|
||||
->assertStatus(200)
|
||||
->assertStatusMessageIs('error')
|
||||
->json();
|
||||
}
|
||||
|
||||
|
||||
public function testDisallowUserDeletionViaApiIfStillManagingPeople()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue