From 6978fbf2e090108849b00a1cb43470194679af87 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sun, 29 Mar 2020 15:35:40 -0400 Subject: [PATCH] Fix API tests --- tests/AcarsTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/AcarsTest.php b/tests/AcarsTest.php index d43fb1b8..0938df1f 100644 --- a/tests/AcarsTest.php +++ b/tests/AcarsTest.php @@ -484,9 +484,9 @@ class AcarsTest extends TestCase $response = $this->get($uri); $response->assertStatus(200); - $body = $response->json('data')[0]; + $body = collect($response->json('data')); + $body = $body->firstWhere('id', $pirep['id']); - $this->assertEquals($pirep->id, $body['id']); $this->assertNotEmpty($body['user']['name']); $this->assertNotEmpty($body['user']['avatar']);