1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-12-14 19:42:14 +03:00

Slugs: Fixed storage bugs, added testing coverage

This commit is contained in:
Dan Brown
2025-11-24 10:46:24 +00:00
parent 291a807d98
commit dd5375f480
5 changed files with 143 additions and 51 deletions

View File

@@ -269,28 +269,6 @@ class PageTest extends TestCase
]);
}
public function test_old_page_slugs_redirect_to_new_pages()
{
$page = $this->entities->page();
// Need to save twice since revisions are not generated in seeder.
$this->asAdmin()->put($page->getUrl(), [
'name' => 'super test',
'html' => '<p></p>',
]);
$page->refresh();
$pageUrl = $page->getUrl();
$this->put($pageUrl, [
'name' => 'super test page',
'html' => '<p></p>',
]);
$this->get($pageUrl)
->assertRedirect("/books/{$page->book->slug}/page/super-test-page");
}
public function test_page_within_chapter_deletion_returns_to_chapter()
{
$chapter = $this->entities->chapter();