Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 058762f

Browse files
committed
test(permission): fix users endpoints tests
1 parent dbc6ed9 commit 058762f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/Feature/Users/UsersEndpointsTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ function test_it_can_create_user_with_associated_role()
264264
$response->assertStatus(201);
265265
$user = User::where('email', '[email protected]')->first();
266266
$roles->each(function($role) use ($user) {
267-
$this->assertDatabaseHas('user_has_roles', [
268-
'user_id' => $user->id,
267+
$this->assertDatabaseHas('model_has_roles', [
268+
'model_id' => $user->id,
269269
'role_id' => $role->id
270270
]);
271271
});
@@ -282,8 +282,8 @@ function test_it_updates_users_roles()
282282
]);
283283
$response->assertStatus(200);
284284
$roles->each(function($role) use ($user) {
285-
$this->assertDatabaseHas('user_has_roles', [
286-
'user_id' => $user->id,
285+
$this->assertDatabaseHas('model_has_roles', [
286+
'model_id' => $user->id,
287287
'role_id' => $role->id
288288
]);
289289
});
@@ -301,8 +301,8 @@ function test_it_deletes_users_roles_if_empty_array_sent()
301301
]);
302302
$response->assertStatus(200);
303303
$roles->each(function($role) use ($user) {
304-
$this->assertDatabaseMissing('user_has_roles', [
305-
'user_id' => $user->id,
304+
$this->assertDatabaseMissing('model_has_roles', [
305+
'model_id' => $user->id,
306306
'role_id' => $role->id
307307
]);
308308
});

0 commit comments

Comments
 (0)