Remove ExportContentJob and spec (#5711)

This commit is contained in:
Alex 2020-01-24 14:13:48 -08:00 committed by GitHub
parent bf40d27054
commit c3529d4b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 34 deletions

View file

@ -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

View file

@ -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