Added testing coverage to API token auth

This commit is contained in:
Dan Brown
2019-12-30 19:42:46 +00:00
parent 6f1b88a6a6
commit 3d11cba223
8 changed files with 126 additions and 7 deletions

View File

@ -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');
}