mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Added more permissions tests to user delete UI
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
e60dbc883c
commit
3825f5fb61
|
@ -49,7 +49,7 @@ class DeleteUserTest extends TestCase
|
|||
}
|
||||
|
||||
|
||||
public function testPermissionsToDeleteUser()
|
||||
public function testFmcsPermissionsToDeleteUser()
|
||||
{
|
||||
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
|
@ -60,14 +60,22 @@ class DeleteUserTest extends TestCase
|
|||
$userFromA = User::factory()->for($companyA)->create();
|
||||
$userFromB = User::factory()->for($companyB)->create();
|
||||
|
||||
$this->followingRedirects()->actingAs(User::factory()->deleteUsers()->for($companyA)->create())
|
||||
$response = $this->followingRedirects()->actingAs(User::factory()->deleteUsers()->for($companyA)->create())
|
||||
->delete(route('users.destroy', ['user' => $userFromB->id]))
|
||||
->assertStatus(403);
|
||||
$this->followRedirects($response)->assertSee('sad-panda.png');
|
||||
|
||||
$this->actingAs(User::factory()->deleteUsers()->for($companyA)->create())
|
||||
$response = $this->actingAs(User::factory()->deleteUsers()->for($companyA)->create())
|
||||
->delete(route('users.destroy', ['user' => $userFromA->id]))
|
||||
->assertStatus(302)
|
||||
->assertRedirect(route('users.index'));
|
||||
$this->followRedirects($response)->assertSee('sad-panda.png');
|
||||
|
||||
$response = $this->actingAs($superuser)
|
||||
->delete(route('users.destroy', ['user' => $userFromA->id]))
|
||||
->assertStatus(302)
|
||||
->assertRedirect(route('users.index'));
|
||||
$this->followRedirects($response)->assertSee('Success');
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue