From 26a262599d13d3b928292e911756de78c8af2057 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Thu, 7 Nov 2019 15:10:41 -0600 Subject: [PATCH] Remove old GenericMailJob --- lib/job_types/generic_mail_job.rb | 21 --------------------- spec/lib/job_types/generic_mail_job_spec.rb | 15 --------------- 2 files changed, 36 deletions(-) delete mode 100644 lib/job_types/generic_mail_job.rb delete mode 100644 spec/lib/job_types/generic_mail_job_spec.rb diff --git a/lib/job_types/generic_mail_job.rb b/lib/job_types/generic_mail_job.rb deleted file mode 100644 index 121baba0..00000000 --- a/lib/job_types/generic_mail_job.rb +++ /dev/null @@ -1,21 +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 GenericMailJob < EmailJob - attr_reader :from_email, :from_name, :message, :subject, :to_email, :to_name - - def initialize(from_email, from_name, message, subject, to_email, to_name) - @from_email = from_email - @from_name = from_name - @message = message - @subject = subject - @to_email = to_email - @to_name = to_name - end - - def perform - GenericMailer.generic_mail(@from_email, @from_name, @message, @subject, @to_email, @to_name).deliver - end - end -end diff --git a/spec/lib/job_types/generic_mail_job_spec.rb b/spec/lib/job_types/generic_mail_job_spec.rb deleted file mode 100644 index d98b9616..00000000 --- a/spec/lib/job_types/generic_mail_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::GenericMailJob do - describe '.perform' do - it 'calls the correct active mailer' do - expect(GenericMailer).to receive(:generic_mail).with(1, 2, 3, 4, 5, 6).and_wrap_original { |_m, *_args| mailer = double('object'); expect(mailer).to receive(:deliver).and_return(nil); mailer } - - job = JobTypes::GenericMailJob.new(1, 2, 3, 4, 5, 6) - job.perform - end - end -end