From: Christopher Wilkinson Date: Wed, 3 Apr 2019 09:05:08 +0000 (+0100) Subject: Add tests for creating a book and adding directly to a shelf X-Git-Tag: v0.26.0~1^2~21^2~3 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/50a9c71de092eab835b9b3b6a8ffd34aede2e3a2 Add tests for creating a book and adding directly to a shelf --- diff --git a/tests/Entity/BookShelfTest.php b/tests/Entity/BookShelfTest.php index a95f31b52..e49c24739 100644 --- a/tests/Entity/BookShelfTest.php +++ b/tests/Entity/BookShelfTest.php @@ -155,7 +155,19 @@ class BookShelfTest extends TestCase $shelf = Bookshelf::first(); $resp = $this->asEditor()->get($shelf->getUrl('/create-book')); - $resp->assertSeeText('Create New Book'); + $resp->assertSee('Create New Book'); + $resp->assertSee($shelf->getShortName()); + + $testName = 'Test Book in Shelf Name'; + + $createBookResp = $this->asEditor()->post($shelf->getUrl('/create-book'), [ + 'name' => $testName, + 'description' => 'Book in shelf description' + ]); + + $resp = $this->asEditor()->get($shelf->getUrl()); + + $resp->assertSee($testName); } public function test_shelf_delete()