feat: Use relay server for self-hosted mobile push notifications (#2757)

This commit is contained in:
Pranav Raj S
2021-08-17 01:44:16 +05:30
committed by GitHub
parent 319412f6dc
commit ed317c5bb3
4 changed files with 33 additions and 3 deletions

View File

@@ -20,17 +20,20 @@ describe Notification::PushNotificationService do
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
ENV['VAPID_PUBLIC_KEY'] = nil
end
it 'sends a fcm notification for firebase subscription' do
ENV['FCM_SERVER_KEY'] = 'test'
ENV['ENABLE_PUSH_RELAY_SERVER'] = 'false'
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
ENV['FCM_SERVER_KEY'] = nil
ENV['ENABLE_PUSH_RELAY_SERVER'] = nil
end
end
end