diff --git a/app/jobs/export_content_job.rb b/app/jobs/export_content_job.rb deleted file mode 100644 index ddab6e5dc..000000000 --- a/app/jobs/export_content_job.rb +++ /dev/null @@ -1,8 +0,0 @@ -class ExportContentJob < ApplicationJob - queue_as :export_content - - def perform(user_id, exporter = Exporter::Service) - user = User.find_by(id: user_id) - exporter.new(user).export(send_email: true) if user - end -end diff --git a/spec/jobs/export_content_job_spec.rb b/spec/jobs/export_content_job_spec.rb deleted file mode 100644 index 0b5bb37fe..000000000 --- a/spec/jobs/export_content_job_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "rails_helper" - -RSpec.describe ExportContentJob, type: :job do - include_examples "#enqueues_job", "export_content", 1 - - describe "#perform_now" do - let(:exporter_service) { double } - let(:exporter) { double } - let(:user) { create(:user) } - - before do - allow(exporter).to receive(:export) - allow(exporter_service).to receive(:new).and_return(exporter) - end - - it "calls the service" do - described_class.perform_now(user.id, exporter_service) - expect(exporter).to have_received(:export).once - end - - it "doesn't call the service if non existent user ID is given" do - described_class.perform_now(9999, exporter_service) - expect(exporter).not_to have_received(:export) - end - end -end