From b84f8278b6f5aa6e68e2ddc0c965a7cea0bda597 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 18 Feb 2017 13:19:34 +0000 Subject: [PATCH] Add Articles tests --- tests/Browser/ArticlesTest.php | 61 +++++++++++++++++++++++++++++++ tests/Feature/ArticlesRSSTest.php | 22 +++++++++++ 2 files changed, 83 insertions(+) create mode 100644 tests/Browser/ArticlesTest.php create mode 100644 tests/Feature/ArticlesRSSTest.php diff --git a/tests/Browser/ArticlesTest.php b/tests/Browser/ArticlesTest.php new file mode 100644 index 00000000..2bb7cba2 --- /dev/null +++ b/tests/Browser/ArticlesTest.php @@ -0,0 +1,61 @@ +browse(function ($browser) { + $browser->visit('/blog') + ->assertSee('My New Blog'); + }); + } + + /** + * Test the `/blog` page with a year scoping results. + * + * @return void + */ + public function test_articles_page_with_specified_year() + { + $this->browse(function ($browser) { + $browser->visit('/blog/2016') + ->assertSee('My New Blog'); + }); + } + + /** + * Test the `/blog` page with a year and month scoping results. + * + * @return void + */ + public function test_articles_page_with_specified_year_and_month() + { + $this->browse(function ($browser) { + $browser->visit('/blog/2016/01') + ->assertSee('My New Blog'); + }); + } + + /** + * Test a single article page. + * + * @return void + */ + public function test_single_article_page() + { + $this->browse(function ($browser) { + $browser->visit('/blog/2016/01/my-new-blog') + ->assertSee('My New Blog'); + }); + } +} diff --git a/tests/Feature/ArticlesRSSTest.php b/tests/Feature/ArticlesRSSTest.php new file mode 100644 index 00000000..5bb10e35 --- /dev/null +++ b/tests/Feature/ArticlesRSSTest.php @@ -0,0 +1,22 @@ +get('/feed'); + $response->assertHeader('Content-Type', 'application/rss+xml'); + } +}