mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 03:04:05 +00:00
35 lines
936 B
PHP
35 lines
936 B
PHP
<?php
|
|
|
|
use App\Order;
|
|
use App\Ticket;
|
|
use App\Concert;
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
class ViewOrderTest extends TestCase
|
|
{
|
|
use DatabaseMigrations;
|
|
|
|
/** @test */
|
|
function user_can_view_their_order_confirmation()
|
|
{
|
|
$this->disableExceptionHandling();
|
|
|
|
$concert = factory(Concert::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
|
|
$response = $this->get("/orders/ORDERCONFIRMATION1234");
|
|
|
|
$response->assertStatus(200);
|
|
// Assert we see the correct order details
|
|
}
|
|
}
|