mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -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()
|
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'))
|
->deleteJson(route('api.users.destroy', 'invalid-id'))
|
||||||
->assertOk()
|
->assertOk()
|
||||||
->assertStatus(200)
|
->assertStatus(200)
|
||||||
|
@ -33,6 +33,17 @@ class DeleteUserTest extends TestCase
|
||||||
->json();
|
->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()
|
public function testDisallowUserDeletionViaApiIfStillManagingPeople()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue