diff --git a/app/jobs/campaign_creation_email_followup_job.rb b/app/jobs/campaign_creation_email_followup_job.rb new file mode 100644 index 00000000..b87bdc2b --- /dev/null +++ b/app/jobs/campaign_creation_email_followup_job.rb @@ -0,0 +1,7 @@ +class CampaignCreationEmailFollowupJob < ApplicationJob + queue_as :default + + def perform(campaign) + CampaignMailer.creation_followup(campaign).deliver_now + end +end diff --git a/lib/job_types/campaign_creation_followup_job.rb b/lib/job_types/campaign_creation_followup_job.rb deleted file mode 100644 index 6c92b870..00000000 --- a/lib/job_types/campaign_creation_followup_job.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later -module JobTypes - class CampaignCreationFollowupJob < EmailJob - attr_reader :campaign - - def initialize(campaign) - @campaign = campaign - end - - def perform - CampaignMailer.creation_followup(@campaign).deliver - end - end -end diff --git a/spec/lib/job_types/campaign_creation_followup_job_spec.rb b/spec/lib/job_types/campaign_creation_followup_job_spec.rb deleted file mode 100644 index 3135defd..00000000 --- a/spec/lib/job_types/campaign_creation_followup_job_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later -require 'rails_helper.rb' - -describe JobTypes::CampaignCreationFollowupJob do - describe '.perform' do - it 'calls the correct active mailer' do - expect(CampaignMailer).to receive(:creation_followup).with(1).and_wrap_original { |_m, *_args| mailer = double('object'); expect(mailer).to receive(:deliver).and_return(nil); mailer } - - job = JobTypes::CampaignCreationFollowupJob.new(1) - job.perform - end - end -end