From 7154d23759c82a0f1f523787d049d5bf0ad0e5a2 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 12 Feb 2024 16:45:18 -0800 Subject: [PATCH] Pass the correct variable to the route helper --- tests/Feature/Checkins/AccessoryCheckinTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Feature/Checkins/AccessoryCheckinTest.php b/tests/Feature/Checkins/AccessoryCheckinTest.php index 5a86a8de74..25cd5d0d87 100644 --- a/tests/Feature/Checkins/AccessoryCheckinTest.php +++ b/tests/Feature/Checkins/AccessoryCheckinTest.php @@ -17,8 +17,10 @@ class AccessoryCheckinTest extends TestCase public function testCheckingInAccessoryRequiresCorrectPermission() { + $accessory = Accessory::factory()->checkedOutToUser()->create(); + $this->actingAs(User::factory()->create()) - ->post(route('accessories.checkin.store', Accessory::factory()->checkedOutToUser()->create())) + ->post(route('accessories.checkin.store', $accessory->users->first()->pivot->id)) ->assertForbidden(); }