Fixed entities created with blank slugs.

Fixes #156.
This commit is contained in:
Dan Brown
2016-08-13 13:53:04 +01:00
parent 07c7d5af17
commit 2d958e88bf
4 changed files with 19 additions and 17 deletions

View File

@ -151,8 +151,10 @@ class EntityTest extends TestCase
->visit('/books/create')
->type($book->name, '#name')
->type($book->description, '#description')
->press('Save Book')
->seePageIs('/books/my-first-book-2');
->press('Save Book');
$expectedPattern = '/\/books\/my-first-book-[0-9a-zA-Z]{3}/';
$this->assertRegExp($expectedPattern, $this->currentUri, "Did not land on expected page [$expectedPattern].\n");
$book = \BookStack\Book::where('slug', '=', 'my-first-book')->first();
return $book;