From c6482bd160590d4daa0c27f59ed959f34c012a47 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Fri, 5 Jun 2020 09:19:18 -0400 Subject: [PATCH] Add last_pirep test --- tests/PIREPTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/PIREPTest.php b/tests/PIREPTest.php index 6df63459..ef2c34ab 100644 --- a/tests/PIREPTest.php +++ b/tests/PIREPTest.php @@ -312,7 +312,8 @@ class PIREPTest extends TestCase } $pilot = User::find($user->id); - $last_pirep = Pirep::where('id', $pilot->last_pirep_id)->first(); + $last_pirep = $pilot->last_pirep; + $this->assertEquals($pilot->last_pirep_id, $last_pirep->id); // Make sure rank went up $this->assertGreaterThan($user->rank_id, $pilot->rank_id);