mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
fix moar tests
This commit is contained in:
parent
ead27accac
commit
1e9922a0b0
|
@ -68,6 +68,7 @@ class CheckoutableListener
|
|||
if ($notifiable instanceof User && $notifiable->email != '') {
|
||||
if ($event->checkoutable->requireAcceptance() || $event->checkoutable->getEula() ||
|
||||
(method_exists($event->checkoutable, 'checkin_email') && $event->checkoutable->checkin_email())) {
|
||||
|
||||
Mail::to($notifiable)->send($mailable);
|
||||
Log::info('Sending email, Locale: ' . ($event->checkedOutTo->locale ?? 'default'));
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ class AccessoryCheckoutTest extends TestCase implements TestsPermissionsRequirem
|
|||
'checkout_to_type' => 'user',
|
||||
]);
|
||||
|
||||
Mail::assertNotSent(CheckoutAccessoryMail::class, function ($mail) use ($user) {
|
||||
Mail::assertSent(CheckoutAccessoryMail::class, function ($mail) use ($user) {
|
||||
return $mail->hasTo($user->email);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -64,7 +64,9 @@ class ConsumableCheckoutTest extends TestCase
|
|||
'assigned_to' => $user->id,
|
||||
]);
|
||||
|
||||
Mail::assertSent($user, CheckoutConsumableMail::class);
|
||||
Mail::assertSent(CheckoutConsumableMail::class, function ($mail) use ($consumable, $user) {
|
||||
return $mail->hasTo($user->email);
|
||||
});
|
||||
}
|
||||
|
||||
public function testActionLogCreatedUponCheckout()
|
||||
|
|
|
@ -140,9 +140,8 @@ class ImportAssetsTest extends ImportDataTestCase implements TestsPermissionsReq
|
|||
//Notes is never read.
|
||||
// $this->assertEquals($row['notes'], $newAsset->notes);
|
||||
|
||||
Mail::assertSent(CheckoutAssetMail::class, function ($mail) use ($assignee) {
|
||||
return $mail->hasTo($assignee->email);
|
||||
});
|
||||
Mail::assertSent(CheckoutAssetMail::class);
|
||||
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
|
|
@ -14,7 +14,6 @@ trait AssertsAgainstSlackNotifications
|
|||
new AnonymousNotifiable,
|
||||
$notificationClass,
|
||||
function ($notification, $channels, $notifiable) {
|
||||
dd($notification);
|
||||
return $notifiable->routes['slack'] === Setting::getSettings()->webhook_endpoint;
|
||||
}
|
||||
);
|
||||
|
|
|
@ -33,7 +33,9 @@ class NotificationTest extends TestCase
|
|||
|
||||
Mail::fake();
|
||||
$asset->checkOut($user, $admin->id);
|
||||
Mail::assertSent($user, CheckoutAssetMail::class);
|
||||
Mail::assertSent(CheckoutAssetMail::class, function ($mail) use ($user) {
|
||||
return $mail->hasTo($user->email);
|
||||
});
|
||||
}
|
||||
public function testDefaultEulaIsSentWhenSetInCategory()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue