mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Add assertion to ensure user cannot perform bulk actions on self
This commit is contained in:
parent
fc405d9d73
commit
5cd9dd4a67
|
@ -48,6 +48,23 @@ class BulkDeleteUsersTest extends TestCase
|
|||
])->assertSessionHas('error')->assertRedirect();
|
||||
}
|
||||
|
||||
public function testCannotPerformBulkActionsOnSelf()
|
||||
{
|
||||
$actor = User::factory()->editUsers()->create();
|
||||
|
||||
$this->actingAs($actor)
|
||||
->post(route('users/bulksave'), [
|
||||
'ids' => [
|
||||
$actor->id,
|
||||
],
|
||||
'delete_user' => '1',
|
||||
])
|
||||
->assertRedirect(route('users.index'))
|
||||
->assertSessionHas('success', trans('general.bulk_checkin_delete_success'));
|
||||
|
||||
$this->assertNotSoftDeleted($actor);
|
||||
}
|
||||
|
||||
public function testAccessoriesCanBeBulkCheckedIn()
|
||||
{
|
||||
[$accessoryA, $accessoryB] = Accessory::factory()->count(2)->create();
|
||||
|
|
Loading…
Reference in a new issue