This commit is contained in:
Godfrey M 2024-10-17 14:56:58 -07:00
parent 7ae76e7db9
commit ff113ef523
3 changed files with 4 additions and 2 deletions

View file

@ -6,6 +6,7 @@ use App\Models\LicenseSeat;
use App\Models\Setting;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Channels\SlackWebhookChannel;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Notification;
@ -58,7 +59,7 @@ class CheckinLicenseSeatNotification extends Notification
}
if (Setting::getSettings()->webhook_selected == 'slack' || Setting::getSettings()->webhook_selected == 'general' ) {
$notifyBy[] = 'slack';
$notifyBy[] = SlackWebhookChannel::class;
}
return $notifyBy;

View file

@ -170,7 +170,7 @@ class AccessoryCheckoutTest extends TestCase
'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);
});
}

View file

@ -14,6 +14,7 @@ trait AssertsAgainstSlackNotifications
new AnonymousNotifiable,
$notificationClass,
function ($notification, $channels, $notifiable) {
dd($notification);
return $notifiable->routes['slack'] === Setting::getSettings()->webhook_endpoint;
}
);