mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-24 21:56:58 +00:00
69 - Sketching Out Order Confirmations
This commit is contained in:
@@ -66,3 +66,10 @@ $factory->state(App\Ticket::class, 'reserved', function ($faker) {
|
|||||||
'reserved_at' => Carbon::now(),
|
'reserved_at' => Carbon::now(),
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$factory->define(App\Order::class, function (Faker\Generator $faker) {
|
||||||
|
return [
|
||||||
|
'amount' => 5250,
|
||||||
|
'email' => 'somebody@example.com',
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|||||||
29
tests/features/ViewOrderTest.php
Normal file
29
tests/features/ViewOrderTest.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?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()
|
||||||
|
{
|
||||||
|
$concert = factory(Concert::class)->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
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user