chore: Switch to web-push gem (#6390)

- The previous gem, `webpush` was last updated a while ago. Also, with the recent ruby upgrade, we needed a fix for zaru/webpush#106. Hence switching to the `web-push` gem where the issues are fixed.
This commit is contained in:
Sojan Jose
2023-02-03 18:55:22 +05:30
committed by GitHub
parent 46eeee7d92
commit 38aee8d9ea
5 changed files with 15 additions and 24 deletions

View File

@@ -7,7 +7,7 @@ describe Notification::PushNotificationService do
let(:fcm_double) { double }
before do
allow(Webpush).to receive(:payload_send).and_return(true)
allow(WebPush).to receive(:payload_send).and_return(true)
allow(FCM).to receive(:new).and_return(fcm_double)
allow(fcm_double).to receive(:send).and_return({ body: { 'results': [] }.to_json })
end
@@ -18,7 +18,7 @@ describe Notification::PushNotificationService do
create(:notification_subscription, user: notification.user)
described_class.new(notification: notification).perform
expect(Webpush).to have_received(:payload_send)
expect(WebPush).to have_received(:payload_send)
expect(FCM).not_to have_received(:new)
end
end
@@ -29,7 +29,7 @@ describe Notification::PushNotificationService do
described_class.new(notification: notification).perform
expect(FCM).to have_received(:new)
expect(Webpush).not_to have_received(:payload_send)
expect(WebPush).not_to have_received(:payload_send)
end
end
end