Commit 5edf8a85 authored by James Edwards-Jones's avatar James Edwards-Jones

Adds ExportCsvWorker spec

parent 2df84af0
require 'spec_helper'
describe ExportCsvWorker do
let(:user) { create(:user) }
let(:project) { create(:empty_project, creator: user) }
def perform(params = {})
described_class.new.perform(user.id, project.id, params)
end
it 'emails a CSV' do
expect{perform}.to change(ActionMailer::Base.deliveries, :size).by(1)
end
it 'ensures that project_id is passed to issues_finder' do
expect(IssuesFinder).to receive(:new).with(anything, hash_including(project_id: project.id)).and_call_original
perform
end
it 'converts controller string keys to symbol keys for IssuesFinder' do
expect(IssuesFinder).to receive(:new).with(anything, hash_including(test_key: true)).and_call_original
perform('test_key' => true)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment