Skip to content

Commit

Permalink
Simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmoore committed Jan 30, 2025
1 parent fc88b24 commit 7e9c564
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions tests/Feature/Notifications/Email/AssetAcceptanceReminderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,9 @@ public function testUserWithoutEmailAddressHandledGracefully($callback)
Mail::assertNotSent(CheckoutAssetMail::class);
}

public static function acceptances()
public function testReminderIsSentToUser()
{
yield 'User with locale set' => [
function () {
return CheckoutAcceptance::factory()->pending()->create();
}
];

yield 'User without locale set' => [
function () {
$checkoutAcceptance = CheckoutAcceptance::factory()->pending()->create();
$checkoutAcceptance->assignedTo->update(['locale' => null]);

return $checkoutAcceptance;
}
];
}

#[DataProvider('acceptances')]
public function testReminderIsSentToUser($callback)
{
$checkoutAcceptance = $callback();
$checkoutAcceptance = CheckoutAcceptance::factory()->pending()->create();

$this->actingAs(User::factory()->canViewReports()->create())
->post($this->routeFor($checkoutAcceptance))
Expand Down

0 comments on commit 7e9c564

Please sign in to comment.