From 990c85143268e6d528e2d156303624642540d9e6 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 18 Feb 2017 14:31:49 +0000 Subject: [PATCH] Add Places Tests --- tests/Feature/PlacesTest.php | 34 ++++++++++++++++++++++++++++++++++ tests/Unit/PlacesTest.php | 22 ++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/Feature/PlacesTest.php create mode 100644 tests/Unit/PlacesTest.php diff --git a/tests/Feature/PlacesTest.php b/tests/Feature/PlacesTest.php new file mode 100644 index 00000000..fca57e0f --- /dev/null +++ b/tests/Feature/PlacesTest.php @@ -0,0 +1,34 @@ +get('/places'); + $response->assertStatus(200); + } + + /** + * Test a specific place. + * + * @return void + */ + public function test_single_place() + { + $place = \App\Place::where('slug', 'the-bridgewater-pub')->first(); + $response = $this->get('/places/the-bridgewater-pub'); + $response->assertViewHas('place', $place); + } +} diff --git a/tests/Unit/PlacesTest.php b/tests/Unit/PlacesTest.php new file mode 100644 index 00000000..0a981725 --- /dev/null +++ b/tests/Unit/PlacesTest.php @@ -0,0 +1,22 @@ +assertEquals('the-bridgewater-pub', $nearby[0]->slug); + } +}