Added test to cover "users" header link in correct permission conditions

This commit is contained in:
Dan Brown 2019-01-05 15:22:47 +00:00
parent f63fd4beca
commit 50e5527483
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -109,6 +109,16 @@ class RolesTest extends BrowserKitTest
->seePageIs('/settings/users');
}
public function test_manage_users_permission_shows_link_in_header_if_does_not_have_settings_manage_permision()
{
$usersLink = 'href="'.url('/settings/users') . '"';
$this->actingAs($this->user)->visit('/')->dontSee($usersLink);
$this->giveUserPermissions($this->user, ['users-manage']);
$this->actingAs($this->user)->visit('/')->see($usersLink);
$this->giveUserPermissions($this->user, ['settings-manage', 'users-manage']);
$this->actingAs($this->user)->visit('/')->dontSee($usersLink);
}
public function test_user_roles_manage_permission()
{
$this->actingAs($this->user)->visit('/settings/roles')