mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-03 05:48:12 +00:00
5.5 - Precomputing the Order Amount
This commit is contained in:
@@ -11,12 +11,12 @@ class OrderTest extends TestCase
|
||||
use DatabaseMigrations;
|
||||
|
||||
/** @test */
|
||||
function creating_an_order_from_tickets_and_email()
|
||||
function creating_an_order_from_tickets_email_and_amount()
|
||||
{
|
||||
$concert = factory(Concert::class)->create(['ticket_price' => 1200])->addTickets(5);
|
||||
$concert = factory(Concert::class)->create()->addTickets(5);
|
||||
$this->assertEquals(5, $concert->ticketsRemaining());
|
||||
|
||||
$order = Order::forTickets($concert->findTickets(3), 'john@example.com');
|
||||
$order = Order::forTickets($concert->findTickets(3), 'john@example.com', 3600);
|
||||
|
||||
$this->assertEquals('john@example.com', $order->email);
|
||||
$this->assertEquals(3, $order->ticketQuantity());
|
||||
|
||||
Reference in New Issue
Block a user