mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-31 14:46:49 +00:00
46 - A Change in Behavior
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\Ticket;
|
||||
use App\Concert;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
@@ -24,14 +25,11 @@ class TicketTest extends TestCase
|
||||
/** @test */
|
||||
function a_ticket_can_be_released()
|
||||
{
|
||||
$concert = factory(Concert::class)->create();
|
||||
$concert->addTickets(1);
|
||||
$order = $concert->orderTickets('jane@example.com', 1);
|
||||
$ticket = $order->tickets()->first();
|
||||
$this->assertEquals($order->id, $ticket->order_id);
|
||||
$ticket = factory(Ticket::class)->states('reserved')->create();
|
||||
$this->assertNotNull($ticket->reserved_at);
|
||||
|
||||
$ticket->release();
|
||||
|
||||
$this->assertNull($ticket->fresh()->order_id);
|
||||
$this->assertNull($ticket->fresh()->reserved_at);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user