mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove WelcomeEnterpriseJob
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WelcomeEnterpriseJob < ActiveJob::Base
|
||||
def perform(enterprise_id)
|
||||
enterprise = Enterprise.find enterprise_id
|
||||
EnterpriseMailer.welcome(enterprise).deliver_now
|
||||
end
|
||||
end
|
||||
@@ -400,7 +400,7 @@ class Enterprise < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def send_welcome_email
|
||||
WelcomeEnterpriseJob.perform_later(id)
|
||||
EnterpriseMailer.welcome(self).deliver_later
|
||||
end
|
||||
|
||||
def strip_url(url)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe WelcomeEnterpriseJob do
|
||||
let(:enterprise) { create(:enterprise) }
|
||||
|
||||
it "sends a welcome email to the enterprise" do
|
||||
mail = double(:mail)
|
||||
expect(EnterpriseMailer).to receive(:welcome).with(enterprise).and_return(mail)
|
||||
expect(mail).to receive(:deliver_now)
|
||||
|
||||
WelcomeEnterpriseJob.perform_now(enterprise.id)
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,9 @@ describe Enterprise do
|
||||
it "sends a welcome email" do
|
||||
expect do
|
||||
create(:enterprise, owner: user)
|
||||
end.to enqueue_job WelcomeEnterpriseJob
|
||||
end.to enqueue_job ActionMailer::DeliveryJob
|
||||
|
||||
expect(enqueued_jobs.last.to_s).to match "welcome"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user