From fe9339fcccb9f45dbef4f5a6cfd6267afffef43e Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Thu, 7 Nov 2019 15:11:41 -0600 Subject: [PATCH] Remove unused EmailJobQueue --- lib/email_job_queue.rb | 8 -------- spec/lib/email_job_queue_spec.rb | 20 -------------------- spec/support/expect.rb | 4 ---- 3 files changed, 32 deletions(-) delete mode 100644 lib/email_job_queue.rb delete mode 100644 spec/lib/email_job_queue_spec.rb diff --git a/lib/email_job_queue.rb b/lib/email_job_queue.rb deleted file mode 100644 index 84e247bd..00000000 --- a/lib/email_job_queue.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later -module EmailJobQueue - def self.queue(klass, *args) - Delayed::Job.enqueue klass.new(*args) - end -end diff --git a/spec/lib/email_job_queue_spec.rb b/spec/lib/email_job_queue_spec.rb deleted file mode 100644 index a912ad90..00000000 --- a/spec/lib/email_job_queue_spec.rb +++ /dev/null @@ -1,20 +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' - -describe EmailJobQueue do - let(:klass) { class_double('FakeClass') } - let(:fake_object) { instance_double('FakeClass') } - it 'handles empty args' do - expect(klass).to receive(:new).and_return(fake_object) - expect(Delayed::Job).to receive(:enqueue).with(fake_object) - EmailJobQueue.queue(klass) - end - - it 'handles other args' do - expect(klass).to receive(:new).with(1, 2).and_return(fake_object) - expect(Delayed::Job).to receive(:enqueue).with(fake_object) - EmailJobQueue.queue(klass, 1, 2) - end -end diff --git a/spec/support/expect.rb b/spec/support/expect.rb index d04f8539..e3b15b09 100644 --- a/spec/support/expect.rb +++ b/spec/support/expect.rb @@ -17,8 +17,4 @@ module Expect expect(list_of_errors.any? { |e| e[:key].to_s == i[:key].to_s && e[:name].to_s == i[:name].to_s }).to eq(true), "#{i[:key]} should have existed for #{i[:name]}" end end - - def expect_email_queued - expect(EmailJobQueue).to receive(:queue) - end end