X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/05666efda9a51f245d23fc33e65cd598180e97da..refs/pull/205/head:/tests/Permissions/RolesTest.php diff --git a/tests/Permissions/RolesTest.php b/tests/Permissions/RolesTest.php index b64f40dc6..7a0515fd9 100644 --- a/tests/Permissions/RolesTest.php +++ b/tests/Permissions/RolesTest.php @@ -544,27 +544,38 @@ class RolesTest extends TestCase ->dontSeeInElement('.book-content', $otherPage->name); } - public function test_public_role_not_visible_in_user_edit_screen() + public function test_public_role_visible_in_user_edit_screen() { $user = \BookStack\User::first(); $this->asAdmin()->visit('/settings/users/' . $user->id) ->seeElement('#roles-admin') - ->dontSeeElement('#roles-public'); + ->seeElement('#roles-public'); } - public function test_public_role_not_visible_in_role_listing() + public function test_public_role_visible_in_role_listing() { $this->asAdmin()->visit('/settings/roles') ->see('Admin') - ->dontSee('Public'); + ->see('Public'); } - public function test_public_role_not_visible_in_default_role_setting() + public function test_public_role_visible_in_default_role_setting() { $this->asAdmin()->visit('/settings') ->seeElement('[data-role-name="admin"]') - ->dontSeeElement('[data-role-name="public"]'); + ->seeElement('[data-role-name="public"]'); } + public function test_public_role_not_deleteable() + { + $this->asAdmin()->visit('/settings/roles') + ->click('Public') + ->see('Edit Role') + ->click('Delete Role') + ->press('Confirm') + ->see('Delete Role') + ->see('Cannot be deleted'); + } + }