From 709e87bf69aee150982477c8c8d7d084b75d115f Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Wed, 16 Nov 2016 16:37:49 -0500 Subject: [PATCH] 4.1 - Asserting Against JSON Responses --- tests/features/PurchaseTicketsTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/features/PurchaseTicketsTest.php b/tests/features/PurchaseTicketsTest.php index b5f23a6..983770e 100644 --- a/tests/features/PurchaseTicketsTest.php +++ b/tests/features/PurchaseTicketsTest.php @@ -41,6 +41,13 @@ class PurchaseTicketsTest extends TestCase ]); $this->assertResponseStatus(201); + + $this->seeJsonSubset([ + 'email' => 'john@example.com', + 'ticket_quantity' => 3, + 'amount' => 9750, + ]); + $this->assertEquals(9750, $this->paymentGateway->totalCharges()); $this->assertTrue($concert->hasOrderFor('john@example.com')); $this->assertEquals(3, $concert->ordersFor('john@example.com')->first()->ticketQuantity());