diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-06 09:08:56 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-06 09:08:56 +0000 |
commit | 0dce1c285f8d6487daf4b83be1ca9585e3a084e6 (patch) | |
tree | f617aa00d3994c2733baaed0205dba0d3bc0413d /spec/workers | |
parent | eefbee4451565989727256d36176dc2950e3a0b7 (diff) | |
download | gitlab-ce-0dce1c285f8d6487daf4b83be1ca9585e3a084e6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/bulk_import_worker_spec.rb | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/spec/workers/bulk_import_worker_spec.rb b/spec/workers/bulk_import_worker_spec.rb index 862dbce3177..12783f40528 100644 --- a/spec/workers/bulk_import_worker_spec.rb +++ b/spec/workers/bulk_import_worker_spec.rb @@ -3,37 +3,14 @@ require 'spec_helper' RSpec.describe BulkImportWorker do - let!(:bulk_import) { create(:bulk_import, :started) } - let!(:entity) { create(:bulk_import_entity, bulk_import: bulk_import) } - let(:importer) { double(execute: nil) } - - subject { described_class.new } - describe '#perform' do - before do - allow(BulkImports::Importers::GroupImporter).to receive(:new).and_return(importer) - end - it 'executes Group Importer' do - expect(importer).to receive(:execute) - - subject.perform(bulk_import.id) - end - - it 'updates bulk import and entity state' do - subject.perform(bulk_import.id) - - expect(bulk_import.reload.human_status_name).to eq('finished') - expect(entity.reload.human_status_name).to eq('finished') - end + bulk_import_id = 1 - context 'when bulk import could not be found' do - it 'does nothing' do - expect(bulk_import).not_to receive(:top_level_groups) - expect(bulk_import).not_to receive(:finish!) + expect(BulkImports::Importers::GroupsImporter) + .to receive(:new).with(bulk_import_id).and_return(double(execute: true)) - subject.perform(non_existing_record_id) - end + described_class.new.perform(bulk_import_id) end end end |