Add Articles tests
This commit is contained in:
parent
0e97512f61
commit
b84f8278b6
2 changed files with 83 additions and 0 deletions
61
tests/Browser/ArticlesTest.php
Normal file
61
tests/Browser/ArticlesTest.php
Normal 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');
|
||||
});
|
||||
}
|
||||
}
|
22
tests/Feature/ArticlesRSSTest.php
Normal file
22
tests/Feature/ArticlesRSSTest.php
Normal 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');
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue