mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 20:22:18 +00: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
|
// Fill out form & save
|
||||||
->type($book->name, '#name')
|
->type($book->name, '#name')
|
||||||
->type($book->description, '#description')
|
->type($book->description, '#description')
|
||||||
|
->press('Select Image')
|
||||||
|
->click('test-image.jpg')
|
||||||
|
->press('Select Image')
|
||||||
->press('Save Book')
|
->press('Save Book')
|
||||||
// Check it redirects correctly
|
// Check it redirects correctly
|
||||||
->seePageIs('/books/my-first-book')
|
->seePageIs('/books/my-first-book')
|
||||||
->see($book->name)->see($book->description);
|
->see($book->name)->see($book->description);
|
||||||
|
|
||||||
|
$book = factory(Book::class)->latest();
|
||||||
|
$this->assertDatabaseHas('images', [
|
||||||
|
'id' => $book->image
|
||||||
|
]);
|
||||||
|
|
||||||
// Ensure duplicate names are given different slugs
|
// Ensure duplicate names are given different slugs
|
||||||
$this->asAdmin()
|
$this->asAdmin()
|
||||||
->visit('/books/create')
|
->visit('/books/create')
|
||||||
->type($book->name, '#name')
|
->type($book->name, '#name')
|
||||||
->type($book->description, '#description')
|
->type($book->description, '#description')
|
||||||
|
->press('Select Image')
|
||||||
|
->click('test-image.jpg')
|
||||||
|
->press('Select Image')
|
||||||
->press('Save Book');
|
->press('Save Book');
|
||||||
|
|
||||||
$expectedPattern = '/\/books\/my-first-book-[0-9a-zA-Z]{3}/';
|
$expectedPattern = '/\/books\/my-first-book-[0-9a-zA-Z]{3}/';
|
||||||
|
Loading…
Reference in New Issue
Block a user