Commit a67245a8 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'jej-add-csv-worker-spec' into 'master'

Adds ExportCsvWorker spec

See merge request !1433
parents a915d418 5edf8a85
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