From fc01f362f72cdd6ed3b90c5292230e87846c5662 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Sun, 28 Mar 2021 21:02:20 -0700 Subject: [PATCH] Test Food create GET request --- tests/Feature/FoodTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Feature/FoodTest.php b/tests/Feature/FoodTest.php index d728aa4..2c8fdb9 100644 --- a/tests/Feature/FoodTest.php +++ b/tests/Feature/FoodTest.php @@ -19,9 +19,14 @@ class FoodTest extends LoggedInTestCase public function testCanAddFood() { + $create_url = action([FoodController::class, 'create']); + $response = $this->get($create_url); + $response->assertOk(); + /** @var \App\Models\Food $food */ $food = Food::factory()->make(); - $response = $this->followingRedirects()->post('/foods', $food->toArray()); + $store_url = action([FoodController::class, 'store']); + $response = $this->followingRedirects()->post($store_url, $food->toArray()); $response->assertOk(); $response->assertSee("Food {$food->name} updated!"); }