70 - Driving out the Endpoint

This commit is contained in:
Adam Wathan
2017-02-10 14:01:13 -05:00
parent b3ff9e8624
commit dac978ea8a
4 changed files with 23 additions and 2 deletions

View File

@@ -14,16 +14,21 @@ class ViewOrderTest extends TestCase
/** @test */
function user_can_view_their_order_confirmation()
{
$this->disableExceptionHandling();
$concert = factory(Concert::class)->create();
$order = factory(Order::class)->create();
$order = factory(Order::class)->create([
'confirmation_number' => 'ORDERCONFIRMATION1234'
]);
$ticket = factory(Ticket::class)->create([
'concert_id' => $concert->id,
'order_id' => $order->id,
]);
// Visit the order confirmation page
$this->get("/orders/{$order->id}");
$response = $this->get("/orders/ORDERCONFIRMATION1234");
$response->assertStatus(200);
// Assert we see the correct order details
}
}