mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-05 01:24:38 +08:00
Prevented mulitple hypens incorrectly in slug
Added test to check slug format. Fixes #589
This commit is contained in:
@ -11,7 +11,6 @@ class EntityTest extends BrowserKitTest
|
||||
|
||||
public function test_entity_creation()
|
||||
{
|
||||
|
||||
// Test Creation
|
||||
$book = $this->bookCreation();
|
||||
$chapter = $this->chapterCreation($book);
|
||||
@ -268,4 +267,14 @@ class EntityTest extends BrowserKitTest
|
||||
}
|
||||
|
||||
|
||||
public function test_slug_format()
|
||||
{
|
||||
$entityRepo = app(EntityRepo::class);
|
||||
$book = $entityRepo->createFromInput('book', [
|
||||
'name' => 'PartA / PartB / PartC'
|
||||
]);
|
||||
|
||||
$this->assertEquals('parta-partb-partc', $book->slug);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user