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