Commit 08d5fe03 authored by Viral Solani's avatar Viral Solani

Add Assertion in to delete test of User , Role and permission

parent 690656c6
...@@ -110,12 +110,9 @@ class ManagePermissionsTest extends TestCase ...@@ -110,12 +110,9 @@ class ManagePermissionsTest extends TestCase
$permission = create(Permission::class); $permission = create(Permission::class);
/*$this->assertDatabaseHas(config('access.permissions_table'), [
['name' => $permission->name, 'id' => $permission->id]
]);*/
$this->actingAs($this->admin) $this->actingAs($this->admin)
->delete(route('admin.access.permission.destroy', $permission)) ->delete(route('admin.access.permission.destroy', $permission))
->assertStatus(302)
->assertSessionHas(['flash_success' => trans('alerts.backend.permissions.deleted')]); ->assertSessionHas(['flash_success' => trans('alerts.backend.permissions.deleted')]);
/*$this->assertDatabaseMissing('permissions', [ /*$this->assertDatabaseMissing('permissions', [
......
...@@ -160,15 +160,15 @@ class ManageRolesTest extends TestCase ...@@ -160,15 +160,15 @@ class ManageRolesTest extends TestCase
$role = create(Role::class); $role = create(Role::class);
/*$this->assertDatabaseHas(config('access.roles_table'), [
['name' => $role->name, 'id' => $role->id]
]);*/
$this->actingAs($this->admin) $this->actingAs($this->admin)
->delete(route('admin.access.role.destroy', $role)) ->delete(route('admin.access.role.destroy', $role))
->assertStatus(302)
->assertSessionHas(['flash_success' => trans('alerts.backend.roles.deleted')]); ->assertSessionHas(['flash_success' => trans('alerts.backend.roles.deleted')]);
//$this->assertDatabaseMissing(config('access.roles_table'), ['name' => $role->name, 'id' => $role->id]); /*$this->assertDatabaseMissing(config('access.roles_table'), [
'name' => $role->name,
'id' => $role->id
]);*/
Event::assertDispatched(RoleDeleted::class); Event::assertDispatched(RoleDeleted::class);
} }
......
...@@ -285,9 +285,13 @@ class ManageUsersTest extends TestCase ...@@ -285,9 +285,13 @@ class ManageUsersTest extends TestCase
$this->actingAs($this->admin) $this->actingAs($this->admin)
->delete(route('admin.access.user.destroy', $user)) ->delete(route('admin.access.user.destroy', $user))
->assertStatus(302)
->assertSessionHas(['flash_success' => trans('alerts.backend.users.deleted')]); ->assertSessionHas(['flash_success' => trans('alerts.backend.users.deleted')]);
$this->assertDatabaseMissing(config('access.users_table'), ['name' => $user->first_name, 'id' => $user->id]); $this->assertDatabaseMissing(config('access.users_table'), [
'name' => $user->first_name,
'id' => $user->id
]);
Event::assertDispatched(UserDeleted::class); Event::assertDispatched(UserDeleted::class);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment