public function test_alert_message_shows_if_someone_else_editing() { $nonEditedPage = \BookStack\Page::take(10)->get()->last(); $addedContent = '<p>test message content</p>'; $this->asAdmin()->visit($this->page->getUrl() . '/edit')->dontSeeInField('html', $addedContent); $newContent = $this->page->html . $addedContent; $newUser = $this->getEditor(); $this->pageRepo->saveUpdateDraft($this->page, ['html' => $newContent]); $this->actingAs($newUser)->visit($this->page->getUrl() . '/edit')->see('Admin has started editing this page'); $this->flushSession(); $this->visit($nonEditedPage->getUrl() . '/edit')->dontSeeInElement('.notification', 'Admin has started editing this page'); }
public function test_page_delete_all_permission() { $this->giveUserPermissions($this->user, ['page-update-all']); $otherPage = \BookStack\Page::take(1)->get()->first(); $this->checkAccessPermission('page-delete-all', [$otherPage->getUrl() . '/delete'], [$otherPage->getUrl() => 'Delete']); $bookUrl = $otherPage->book->getUrl(); $this->visit($otherPage->getUrl())->visit($otherPage->getUrl() . '/delete')->press('Confirm')->seePageIs($bookUrl)->dontSeeInElement('.book-content', $otherPage->name); }