diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-01-07 23:15:53 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-01-07 23:15:53 +0000 |
commit | cfa7108210490704a8110ee97a26de9ae4d9adaf (patch) | |
tree | 4c66dc55df99405b8aba8ed9fa0e3d1fd34eb30e /spec/workers | |
parent | 420fb032fc9760395c96bafd3f6600950c2125f4 (diff) | |
parent | f54290de751e365be0928c66bb75fd106bb7aa88 (diff) | |
download | gitlab-ce-cfa7108210490704a8110ee97a26de9ae4d9adaf.tar.gz |
Merge branch '49231-import-issues-csv' into 'master'
Import issues from CSV
Closes #49231
See merge request gitlab-org/gitlab-ce!23532
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/import_issues_csv_worker_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/workers/import_issues_csv_worker_spec.rb b/spec/workers/import_issues_csv_worker_spec.rb new file mode 100644 index 00000000000..89370c4890d --- /dev/null +++ b/spec/workers/import_issues_csv_worker_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe ImportIssuesCsvWorker do + let(:project) { create(:project) } + let(:user) { create(:user) } + let(:upload) { create(:upload) } + + let(:worker) { described_class.new } + + describe '#perform' do + it 'calls #execute on Issues::ImportCsvService and destroys upload' do + expect_any_instance_of(Issues::ImportCsvService).to receive(:execute).and_return({ success: 5, errors: [], valid_file: true }) + + worker.perform(user.id, project.id, upload.id) + + expect { upload.reload }.to raise_error ActiveRecord::RecordNotFound + end + end +end |