]> BookStack Code Mirror - bookstack/blobdiff - tests/User/UserApiTokenTest.php
Update settings.php
[bookstack] / tests / User / UserApiTokenTest.php
index 460752fc266de5272d5a182bce779168eac7eafe..f738eb579e4f9a836bc7f818e7de39e59a78ace9 100644 (file)
@@ -1,4 +1,4 @@
-<?php namespace Test;
+<?php namespace Test\User;
 
 use BookStack\Api\ApiToken;
 use Carbon\Carbon;
@@ -14,7 +14,7 @@ class UserApiTokenTest extends TestCase
 
     public function test_tokens_section_not_visible_without_access_api_permission()
     {
-        $user = $this->getEditor();
+        $user = $this->getViewer();
 
         $resp = $this->actingAs($user)->get($user->getEditUrl());
         $resp->assertDontSeeText('API Tokens');
@@ -30,9 +30,9 @@ class UserApiTokenTest extends TestCase
     {
         $viewer = $this->getViewer();
         $editor = $this->getEditor();
-        $this->giveUserPermissions($editor, ['users-manage']);
+        $this->giveUserPermissions($viewer, ['users-manage']);
 
-        $resp = $this->actingAs($editor)->get($viewer->getEditUrl());
+        $resp = $this->actingAs($viewer)->get($editor->getEditUrl());
         $resp->assertSeeText('API Tokens');
         $resp->assertDontSeeText('Create Token');
     }