X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/72c8b138e12a0596c56538e4c43e52847bfec2e0..refs/pull/3698/head:/tests/Entity/ChapterTest.php diff --git a/tests/Entity/ChapterTest.php b/tests/Entity/ChapterTest.php index 5a761b94f..d58b83da9 100644 --- a/tests/Entity/ChapterTest.php +++ b/tests/Entity/ChapterTest.php @@ -146,4 +146,16 @@ class ChapterTest extends TestCase $newChapter2 = Chapter::query()->where('name', '=', 'My copied again chapter')->first(); $this->assertEquals($chapter->pages()->count(), $newChapter2->pages()->count()); } + + public function test_sort_book_action_visible_if_permissions_allow() + { + /** @var Chapter $chapter */ + $chapter = Chapter::query()->first(); + + $resp = $this->actingAs($this->getViewer())->get($chapter->getUrl()); + $this->withHtml($resp)->assertLinkNotExists($chapter->book->getUrl('sort')); + + $resp = $this->asEditor()->get($chapter->getUrl()); + $this->withHtml($resp)->assertLinkExists($chapter->book->getUrl('sort')); + } }