From 50a9c71de092eab835b9b3b6a8ffd34aede2e3a2 Mon Sep 17 00:00:00 2001 From: Christopher Wilkinson Date: Wed, 3 Apr 2019 10:05:08 +0100 Subject: [PATCH] Add tests for creating a book and adding directly to a shelf --- tests/Entity/BookShelfTest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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()