BookStack/tests/Entity/SortTest.php
Dan Brown 8933179017 Prevented drafts from showing up in a book sort
Added tests to cover regresssion.
In reference to #100.
2016-04-15 19:51:27 +01:00

25 lines
542 B
PHP

<?php
class SortTest extends TestCase
{
protected $book;
public function setUp()
{
parent::setUp();
$this->book = \BookStack\Book::first();
}
public function test_drafts_do_not_show_up()
{
$this->asAdmin();
$pageRepo = app('\BookStack\Repos\PageRepo');
$draft = $pageRepo->getDraftPage($this->book);
$this->visit($this->book->getUrl())
->see($draft->name)
->visit($this->book->getUrl() . '/sort')
->dontSee($draft->name);
}
}