mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
120 - Creating Tickets at Time of Publish
This commit is contained in:
@@ -61,12 +61,17 @@ class ConcertTest extends TestCase
|
||||
/** @test */
|
||||
function concerts_can_be_published()
|
||||
{
|
||||
$concert = factory(Concert::class)->create(['published_at' => null]);
|
||||
$concert = factory(Concert::class)->create([
|
||||
'published_at' => null,
|
||||
'ticket_quantity' => 5,
|
||||
]);
|
||||
$this->assertFalse($concert->isPublished());
|
||||
$this->assertEquals(0, $concert->ticketsRemaining());
|
||||
|
||||
$concert->publish();
|
||||
|
||||
$this->assertTrue($concert->isPublished());
|
||||
$this->assertEquals(5, $concert->ticketsRemaining());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
|
||||
Reference in New Issue
Block a user