Remove ExportContentJob and spec (#5711)
This commit is contained in:
parent
bf40d27054
commit
c3529d4b10
2 changed files with 0 additions and 34 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue