remove unused welcome notification job (#5535)

This commit is contained in:
serena 2020-01-15 21:57:33 +00:00 committed by Ben Halpern
parent 0c6e696f2d
commit 5e761fc570
2 changed files with 0 additions and 33 deletions

View file

@ -1,11 +0,0 @@
module Notifications
class WelcomeNotificationJob < ApplicationJob
queue_as :send_welcome_notification
def perform(receiver_id, service = WelcomeNotification::Send)
welcome_broadcast = Broadcast.find_by(title: "Welcome Notification")
service.call(receiver_id, welcome_broadcast) if welcome_broadcast
end
end
end

View file

@ -1,22 +0,0 @@
require "rails_helper"
RSpec.describe Notifications::WelcomeNotificationJob, type: :job do
include_examples "#enqueues_job", "send_welcome_notification"
describe "::perform_now" do
let(:welcome_notification_service) { double }
before do
create(:broadcast, :onboarding)
allow(welcome_notification_service).to receive(:call)
allow(User).to receive(:dev_account).and_return(create(:user))
end
it "calls the service" do
user = create(:user)
described_class.perform_now(user.id, welcome_notification_service)
expect(welcome_notification_service).to have_received(:call).once
end
end
end