1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Copied over work from user_permissions branch

Only that relevant to the additional testing work.
This commit is contained in:
Dan Brown
2023-01-21 11:08:34 +00:00
parent 6070d804f8
commit c724bfe4d3
72 changed files with 1566 additions and 545 deletions

View File

@ -39,7 +39,7 @@ class PageDraftTest extends TestCase
$this->withHtml($resp)->assertElementNotContains('[name="html"]', $addedContent);
$newContent = $this->page->html . $addedContent;
$newUser = $this->getEditor();
$newUser = $this->users->editor();
$this->pageRepo->updatePageDraft($this->page, ['html' => $newContent]);
$resp = $this->actingAs($newUser)->get($this->page->getUrl('/edit'));
@ -62,7 +62,7 @@ class PageDraftTest extends TestCase
$this->withHtml($resp)->assertElementNotContains('[name="html"]', $addedContent);
$newContent = $this->page->html . $addedContent;
$newUser = $this->getEditor();
$newUser = $this->users->editor();
$this->pageRepo->updatePageDraft($this->page, ['html' => $newContent]);
$this->actingAs($newUser)
@ -75,8 +75,8 @@ class PageDraftTest extends TestCase
public function test_draft_save_shows_alert_if_draft_older_than_last_page_update()
{
$admin = $this->getAdmin();
$editor = $this->getEditor();
$admin = $this->users->admin();
$editor = $this->users->editor();
$page = $this->entities->page();
$this->actingAs($editor)->put('/ajax/page/' . $page->id . '/save-draft', [
@ -109,8 +109,8 @@ class PageDraftTest extends TestCase
public function test_draft_save_shows_alert_if_draft_edit_started_by_someone_else()
{
$admin = $this->getAdmin();
$editor = $this->getEditor();
$admin = $this->users->admin();
$editor = $this->users->editor();
$page = $this->entities->page();
$this->actingAs($admin)->put('/ajax/page/' . $page->id . '/save-draft', [
@ -143,7 +143,7 @@ class PageDraftTest extends TestCase
{
$book = $this->entities->book();
$chapter = $book->chapters->first();
$newUser = $this->getEditor();
$newUser = $this->users->editor();
$this->actingAs($newUser)->get($book->getUrl('/create-page'));
$this->get($chapter->getUrl('/create-page'));