From 4e7c6bd2cfd87901fec2c71cde855f4c63f77c0c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 Jan 2025 16:14:09 -0800 Subject: [PATCH] Fix relationship --- .../Email/AssetAcceptanceReminderTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Feature/Notifications/Email/AssetAcceptanceReminderTest.php b/tests/Feature/Notifications/Email/AssetAcceptanceReminderTest.php index 7411cfbd3b..4898234e10 100644 --- a/tests/Feature/Notifications/Email/AssetAcceptanceReminderTest.php +++ b/tests/Feature/Notifications/Email/AssetAcceptanceReminderTest.php @@ -55,13 +55,13 @@ class AssetAcceptanceReminderTest extends TestCase public function testUserWithoutEmailAddressHandledGracefully() { - $userWithoutEmailAddress = User::factory()->create(['email' => null]); - - $this->checkoutAcceptance->assigned_to_id = $userWithoutEmailAddress->id; - $this->checkoutAcceptance->save(); + $checkoutAcceptance = CheckoutAcceptance::factory() + ->pending() + ->forAssignedTo(['email' => null]) + ->create(); $this->actingAs($this->actor) - ->post($this->routeFor($this->checkoutAcceptance)) + ->post($this->routeFor($checkoutAcceptance)) // check we didn't crash... ->assertRedirect();