Improve test case

This commit is contained in:
Marcus Moore 2025-01-29 15:20:56 -08:00
parent fd60ce1198
commit fdcb891cbb
No known key found for this signature in database

View file

@ -7,9 +7,7 @@ use App\Models\Asset;
use App\Models\AssetModel; use App\Models\AssetModel;
use App\Models\Category; use App\Models\Category;
use Carbon\Carbon; use Carbon\Carbon;
use App\Notifications\CheckoutAssetNotification;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Notification;
use Tests\TestCase; use Tests\TestCase;
class NotificationTest extends TestCase class NotificationTest extends TestCase
@ -33,8 +31,8 @@ class NotificationTest extends TestCase
Mail::fake(); Mail::fake();
$asset->checkOut($user, $admin->id); $asset->checkOut($user, $admin->id);
Mail::assertSent(CheckoutAssetMail::class, function ($mail) use ($user) { Mail::assertSent(CheckoutAssetMail::class, function (CheckoutAssetMail $mail) use ($user) {
return $mail->hasTo($user->email); return $mail->hasTo($user->email) && $mail->hasSubject(trans('mail.Asset_Checkout_Notification'));
}); });
} }
public function testDefaultEulaIsSentWhenSetInCategory() public function testDefaultEulaIsSentWhenSetInCategory()