diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /spec/workers/export_csv_worker_spec.rb | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'spec/workers/export_csv_worker_spec.rb')
-rw-r--r-- | spec/workers/export_csv_worker_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/workers/export_csv_worker_spec.rb b/spec/workers/export_csv_worker_spec.rb new file mode 100644 index 00000000000..87285b6264a --- /dev/null +++ b/spec/workers/export_csv_worker_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe ExportCsvWorker do + let(:user) { create(:user) } + let(:project) { create(: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 'removes sort parameter' do + expect(IssuesFinder).to receive(:new).with(anything, hash_not_including(:sort)).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 |