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();