Chore: Fix failing sidekiq events for contact create (#966)

This commit is contained in:
Sojan Jose
2020-06-16 19:39:57 +05:30
committed by GitHub
parent b0bbd757b5
commit 04f6460afb
7 changed files with 21 additions and 15 deletions

View File

@@ -14,19 +14,23 @@ describe Notification::PushNotificationService do
describe '#perform' do
it 'sends webpush notifications for webpush subscription' do
ENV['VAPID_PUBLIC_KEY'] = 'test'
create(:notification_subscription, user: notification.user)
described_class.new(notification: notification).perform
expect(Webpush).to have_received(:payload_send)
expect(FCM).not_to have_received(:new)
ENV['ENABLE_ACCOUNT_SIGNUP'] = nil
end
it 'sends a fcm notification for firebase subscription' do
ENV['FCM_SERVER_KEY'] = 'test'
create(:notification_subscription, user: notification.user, subscription_type: 'fcm')
described_class.new(notification: notification).perform
expect(FCM).to have_received(:new)
expect(Webpush).not_to have_received(:payload_send)
ENV['ENABLE_ACCOUNT_SIGNUP'] = nil
end
end
end