mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-23 14:48:20 +08:00
Cover image test case
This commit is contained in:
parent
21a8df78ee
commit
8f3adcda5d
|
@ -145,16 +145,27 @@ class EntityTest extends BrowserKitTest
|
|||
// Fill out form & save
|
||||
->type($book->name, '#name')
|
||||
->type($book->description, '#description')
|
||||
->press('Select Image')
|
||||
->click('test-image.jpg')
|
||||
->press('Select Image')
|
||||
->press('Save Book')
|
||||
// Check it redirects correctly
|
||||
->seePageIs('/books/my-first-book')
|
||||
->see($book->name)->see($book->description);
|
||||
|
||||
$book = factory(Book::class)->latest();
|
||||
$this->assertDatabaseHas('images', [
|
||||
'id' => $book->image
|
||||
]);
|
||||
|
||||
// Ensure duplicate names are given different slugs
|
||||
$this->asAdmin()
|
||||
->visit('/books/create')
|
||||
->type($book->name, '#name')
|
||||
->type($book->description, '#description')
|
||||
->press('Select Image')
|
||||
->click('test-image.jpg')
|
||||
->press('Select Image')
|
||||
->press('Save Book');
|
||||
|
||||
$expectedPattern = '/\/books\/my-first-book-[0-9a-zA-Z]{3}/';
|
||||
|
|
Loading…
Reference in New Issue
Block a user