mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Updated page revisions link visibility
To match the actual visibilities of the revisions listing page and options. Related to #2946
This commit is contained in:
@ -9,6 +9,18 @@ use Tests\TestCase;
|
||||
|
||||
class PageRevisionTest extends TestCase
|
||||
{
|
||||
|
||||
public function test_revision_links_visible_to_viewer()
|
||||
{
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->first();
|
||||
|
||||
$html = $this->withHtml($this->asViewer()->get($page->getUrl()));
|
||||
$html->assertLinkExists($page->getUrl('/revisions'));
|
||||
$html->assertElementContains('a', 'Revisions');
|
||||
$html->assertElementContains('a', 'Revision #1');
|
||||
}
|
||||
|
||||
public function test_page_revision_views_viewable()
|
||||
{
|
||||
$this->asEditor();
|
||||
|
@ -89,6 +89,14 @@ abstract class TestCase extends BaseTestCase
|
||||
return $this->editor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current user context to be a viewer.
|
||||
*/
|
||||
public function asViewer()
|
||||
{
|
||||
return $this->actingAs($this->getViewer());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instance of a user with 'viewer' permissions.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user