diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index b1d7ce0..b53309a 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -66,3 +66,10 @@ $factory->state(App\Ticket::class, 'reserved', function ($faker) { 'reserved_at' => Carbon::now(), ]; }); + +$factory->define(App\Order::class, function (Faker\Generator $faker) { + return [ + 'amount' => 5250, + 'email' => 'somebody@example.com', + ]; +}); diff --git a/tests/features/ViewOrderTest.php b/tests/features/ViewOrderTest.php new file mode 100644 index 0000000..96f5492 --- /dev/null +++ b/tests/features/ViewOrderTest.php @@ -0,0 +1,29 @@ +create(); + $order = factory(Order::class)->create(); + $ticket = factory(Ticket::class)->create([ + 'concert_id' => $concert->id, + 'order_id' => $order->id, + ]); + + // Visit the order confirmation page + $this->get("/orders/{$order->id}"); + + // Assert we see the correct order details + } +}