Add Articles tests

This commit is contained in:
Jonny Barnes 2017-02-18 13:19:34 +00:00
parent 0e97512f61
commit b84f8278b6
2 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,61 @@
<?php
namespace Tests\Browser;
use Tests\DuskTestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class ArticlesTest extends DuskTestCase
{
/**
* Test the `/blog` page.
*
* @return void
*/
public function test_articles_page()
{
$this->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');
});
}
}

View file

@ -0,0 +1,22 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ArticlesRSSTest extends TestCase
{
/**
* Test the RSS feed.
*
* @return void
*/
public function test_rss_feed()
{
$response = $this->get('/feed');
$response->assertHeader('Content-Type', 'application/rss+xml');
}
}