mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-05 01:48:46 +00:00
6.8 - Reserving Individual Tickets
This commit is contained in:
@@ -117,4 +117,16 @@ class ConcertTest extends TestCase
|
||||
|
||||
$this->fail("Order succeeded even though there were not enough tickets remaining.");
|
||||
}
|
||||
|
||||
/** @test */
|
||||
function can_reserve_available_tickets()
|
||||
{
|
||||
$concert = factory(Concert::class)->create()->addTickets(3);
|
||||
$this->assertEquals(3, $concert->ticketsRemaining());
|
||||
|
||||
$reservedTickets = $concert->reserveTickets(2);
|
||||
|
||||
$this->assertCount(2, $reservedTickets);
|
||||
$this->assertEquals(1, $concert->ticketsRemaining());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user