mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Fixed tests
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
374c6845d6
commit
7ac315e1eb
|
@ -11,6 +11,9 @@ use Illuminate\Http\Request;
|
|||
|
||||
class DeleteUserRequest extends FormRequest
|
||||
{
|
||||
|
||||
protected $redirectRoute = 'users.index';
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
|
|
|
@ -99,7 +99,14 @@ class DeleteUserTest extends TestCase
|
|||
public function testDisallowUserDeletionIfTheyStillHaveAssets()
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
Asset::factory()->count(6)->checkedOutToUser($user)->create();
|
||||
$asset = Asset::factory()->create();
|
||||
|
||||
$this->actingAs(User::factory()->checkoutAssets()->create())
|
||||
->post(route('hardware.checkout.store', $asset->id), [
|
||||
'checkout_to_type' => 'user',
|
||||
'assigned_user' => $user->id,
|
||||
'name' => 'Changed Name',
|
||||
]);
|
||||
|
||||
$this->actingAs(User::factory()->deleteUsers()->viewUsers()->create())->assertFalse($user->isDeletable());
|
||||
|
||||
|
|
Loading…
Reference in a new issue