mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Copied over work from user_permissions branch
Only that relevant to the additional testing work.
This commit is contained in:
@@ -25,7 +25,7 @@ class PageTemplateTest extends TestCase
|
||||
public function test_manage_templates_permission_required_to_change_page_template_status()
|
||||
{
|
||||
$page = $this->entities->page();
|
||||
$editor = $this->getEditor();
|
||||
$editor = $this->users->editor();
|
||||
$this->actingAs($editor);
|
||||
|
||||
$pageUpdateData = [
|
||||
@@ -40,7 +40,7 @@ class PageTemplateTest extends TestCase
|
||||
'template' => false,
|
||||
]);
|
||||
|
||||
$this->giveUserPermissions($editor, ['templates-manage']);
|
||||
$this->permissions->grantUserRolePermissions($editor, ['templates-manage']);
|
||||
|
||||
$this->put($page->getUrl(), $pageUpdateData);
|
||||
$this->assertDatabaseHas('pages', [
|
||||
@@ -53,7 +53,7 @@ class PageTemplateTest extends TestCase
|
||||
{
|
||||
$content = '<div>my_custom_template_content</div>';
|
||||
$page = $this->entities->page();
|
||||
$editor = $this->getEditor();
|
||||
$editor = $this->users->editor();
|
||||
$this->actingAs($editor);
|
||||
|
||||
$templateFetch = $this->get('/templates/' . $page->id);
|
||||
@@ -73,7 +73,7 @@ class PageTemplateTest extends TestCase
|
||||
|
||||
public function test_template_endpoint_returns_paginated_list_of_templates()
|
||||
{
|
||||
$editor = $this->getEditor();
|
||||
$editor = $this->users->editor();
|
||||
$this->actingAs($editor);
|
||||
|
||||
$toBeTemplates = Page::query()->orderBy('name', 'asc')->take(12)->get();
|
||||
|
Reference in New Issue
Block a user