profile test passes now
This commit is contained in:
@@ -50,9 +50,27 @@ test('email verification status is unchanged when the email address is unchanged
|
||||
expect($user->refresh()->email_verified_at)->not->toBeNull();
|
||||
});
|
||||
|
||||
test('user is prevented from deleting their account if they own organisations', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this
|
||||
->actingAs($user)
|
||||
->delete('/settings/profile', [
|
||||
'password' => 'password',
|
||||
]);
|
||||
|
||||
$response
|
||||
->assertSessionHasErrors('password');
|
||||
|
||||
expect($user->fresh())->not->toBeNull();
|
||||
});
|
||||
|
||||
test('user can delete their account', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$user->ownedOrganisations()->delete();
|
||||
$user->organisations()->delete();
|
||||
|
||||
$response = $this
|
||||
->actingAs($user)
|
||||
->delete('/settings/profile', [
|
||||
|
||||
Reference in New Issue
Block a user