1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added Bookshelves to search system.

Also cleaned up and made search indexing system a little more efficient.
Closes #1023
This commit is contained in:
Dan Brown
2018-09-23 12:34:30 +01:00
parent eebfd8904e
commit 7b32aa163f
5 changed files with 36 additions and 24 deletions

View File

@ -1,6 +1,7 @@
<?php namespace Tests;
use BookStack\Bookshelf;
use BookStack\Chapter;
use BookStack\Page;
@ -17,6 +18,14 @@ class EntitySearchTest extends TestCase
$search->assertSee($page->name);
}
public function test_bookshelf_search()
{
$shelf = Bookshelf::first();
$search = $this->asEditor()->get('/search?term=' . urlencode(mb_substr($shelf->name, 0, 3)) . ' {type:bookshelf}');
$search->assertStatus(200);
$search->assertSee($shelf->name);
}
public function test_invalid_page_search()
{
$resp = $this->asEditor()->get('/search?term=' . urlencode('<p>test</p>'));