mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-02 11:47:51 +00:00
100 - Namespacing Our Test Suite
This commit is contained in:
53
tests/Feature/ViewConcertListingTest.php
Normal file
53
tests/Feature/ViewConcertListingTest.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Concert;
|
||||
use Carbon\Carbon;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
|
||||
class ViewConcertListingTest extends TestCase
|
||||
{
|
||||
use DatabaseMigrations;
|
||||
|
||||
/** @test */
|
||||
function user_can_view_a_published_concert_listing()
|
||||
{
|
||||
$concert = factory(Concert::class)->states('published')->create([
|
||||
'title' => 'The Red Chord',
|
||||
'subtitle' => 'with Animosity and Lethargy',
|
||||
'date' => Carbon::parse('December 13, 2016 8:00pm'),
|
||||
'ticket_price' => 3250,
|
||||
'venue' => 'The Mosh Pit',
|
||||
'venue_address' => '123 Example Lane',
|
||||
'city' => 'Laraville',
|
||||
'state' => 'ON',
|
||||
'zip' => '17916',
|
||||
'additional_information' => 'For tickets, call (555) 555-5555.',
|
||||
]);
|
||||
|
||||
$response = $this->get('/concerts/'.$concert->id);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('The Red Chord');
|
||||
$response->assertSee('with Animosity and Lethargy');
|
||||
$response->assertSee('December 13, 2016');
|
||||
$response->assertSee('8:00pm');
|
||||
$response->assertSee('32.50');
|
||||
$response->assertSee('The Mosh Pit');
|
||||
$response->assertSee('123 Example Lane');
|
||||
$response->assertSee('Laraville, ON 17916');
|
||||
$response->assertSee('For tickets, call (555) 555-5555.');
|
||||
}
|
||||
|
||||
/** @test */
|
||||
function user_cannot_view_unpublished_concert_listings()
|
||||
{
|
||||
$concert = factory(Concert::class)->states('unpublished')->create();
|
||||
|
||||
$response = $this->get('/concerts/'.$concert->id);
|
||||
|
||||
$response->assertStatus(404);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user