Added more tests to increase test coverage

This commit is contained in:
Dan Brown
2016-01-02 14:48:35 +00:00
parent f60a0c3b76
commit d3709de035
10 changed files with 97 additions and 33 deletions

View File

@ -188,6 +188,29 @@ class EntityTest extends TestCase
->seePageIs('/');
}
public function testBookSearch()
{
$book = \BookStack\Book::all()->first();
$page = $book->pages->last();
$chapter = $book->chapters->last();
$this->asAdmin()
->visit('/search/book/' . $book->id . '?term=' . urlencode($page->name))
->see($page->name)
->visit('/search/book/' . $book->id . '?term=' . urlencode($chapter->name))
->see($chapter->name);
}
public function testEmptyBookSearchRedirectsBack()
{
$book = \BookStack\Book::all()->first();
$this->asAdmin()
->visit('/books')
->visit('/search/book/' . $book->id . '?term=')
->seePageIs('/books');
}
public function testEntitiesViewableAfterCreatorDeletion()
{