mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-03 23:48:16 +00:00
3.4 - Finishing the Feature Test
This commit is contained in:
@@ -33,6 +33,7 @@ class PurchaseTicketsTest extends TestCase
|
||||
function customer_can_purchase_tickets_to_a_published_concert()
|
||||
{
|
||||
$concert = factory(Concert::class)->states('published')->create(['ticket_price' => 3250]);
|
||||
$concert->addTickets(3);
|
||||
|
||||
$this->orderTickets($concert, [
|
||||
'email' => 'john@example.com',
|
||||
@@ -51,6 +52,7 @@ class PurchaseTicketsTest extends TestCase
|
||||
function cannot_purchase_tickets_to_an_unpublished_concert()
|
||||
{
|
||||
$concert = factory(Concert::class)->states('unpublished')->create();
|
||||
$concert->addTickets(3);
|
||||
|
||||
$this->orderTickets($concert, [
|
||||
'email' => 'john@example.com',
|
||||
@@ -67,6 +69,7 @@ class PurchaseTicketsTest extends TestCase
|
||||
function an_order_is_not_created_if_payment_fails()
|
||||
{
|
||||
$concert = factory(Concert::class)->states('published')->create(['ticket_price' => 3250]);
|
||||
$concert->addTickets(3);
|
||||
|
||||
$this->orderTickets($concert, [
|
||||
'email' => 'john@example.com',
|
||||
@@ -82,6 +85,8 @@ class PurchaseTicketsTest extends TestCase
|
||||
/** @test */
|
||||
function cannot_purchase_more_tickets_than_remain()
|
||||
{
|
||||
$this->disableExceptionHandling();
|
||||
|
||||
$concert = factory(Concert::class)->states('published')->create();
|
||||
$concert->addTickets(50);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user