mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-10 02:51:16 +00:00
76 - Fixing the Testsuite
This commit is contained in:
@@ -15,10 +15,10 @@ class CreateOrdersTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('orders', function (Blueprint $table) {
|
Schema::create('orders', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('confirmation_number');
|
$table->string('confirmation_number')->nullable();
|
||||||
$table->integer('amount');
|
$table->integer('amount');
|
||||||
$table->string('email');
|
$table->string('email');
|
||||||
$table->string('card_last_four');
|
$table->string('card_last_four')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class CreateTicketsTable extends Migration
|
|||||||
$table->unsignedInteger('concert_id');
|
$table->unsignedInteger('concert_id');
|
||||||
$table->unsignedInteger('order_id')->nullable();
|
$table->unsignedInteger('order_id')->nullable();
|
||||||
$table->datetime('reserved_at')->nullable();
|
$table->datetime('reserved_at')->nullable();
|
||||||
$table->string('code');
|
$table->string('code')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ class PurchaseTicketsTest extends TestCase
|
|||||||
function customer_can_purchase_tickets_to_a_published_concert()
|
function customer_can_purchase_tickets_to_a_published_concert()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->disableExceptionHandling();
|
||||||
|
|
||||||
|
// The API we need in our app to be able to use a different generation strategy in our tests...
|
||||||
|
// $orderConfirmationNumberGenerator->generate(); // 'ORDERCONFIRMATION1234'
|
||||||
|
|
||||||
$concert = factory(Concert::class)->states('published')->create(['ticket_price' => 3250])->addTickets(3);
|
$concert = factory(Concert::class)->states('published')->create(['ticket_price' => 3250])->addTickets(3);
|
||||||
|
|
||||||
$this->orderTickets($concert, [
|
$this->orderTickets($concert, [
|
||||||
@@ -61,6 +65,7 @@ class PurchaseTicketsTest extends TestCase
|
|||||||
$this->assertResponseStatus(201);
|
$this->assertResponseStatus(201);
|
||||||
|
|
||||||
$this->seeJsonSubset([
|
$this->seeJsonSubset([
|
||||||
|
// 'confirmation_number' => 'ORDERCONFIRMATION1234',
|
||||||
'email' => 'john@example.com',
|
'email' => 'john@example.com',
|
||||||
'ticket_quantity' => 3,
|
'ticket_quantity' => 3,
|
||||||
'amount' => 9750,
|
'amount' => 9750,
|
||||||
|
|||||||
Reference in New Issue
Block a user