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:
@ -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>'));
|
||||
|
Reference in New Issue
Block a user