diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 23:50:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 23:50:22 +0000 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /spec/lib/bulk_imports/importers/group_importer_spec.rb | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) | |
download | gitlab-ce-9dc93a4519d9d5d7be48ff274127136236a3adb3.tar.gz |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'spec/lib/bulk_imports/importers/group_importer_spec.rb')
-rw-r--r-- | spec/lib/bulk_imports/importers/group_importer_spec.rb | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/spec/lib/bulk_imports/importers/group_importer_spec.rb b/spec/lib/bulk_imports/importers/group_importer_spec.rb deleted file mode 100644 index 5d501b49e41..00000000000 --- a/spec/lib/bulk_imports/importers/group_importer_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe BulkImports::Importers::GroupImporter do - let(:user) { create(:user) } - let(:group) { create(:group) } - let(:bulk_import) { create(:bulk_import) } - let(:bulk_import_entity) { create(:bulk_import_entity, :started, bulk_import: bulk_import, group: group) } - let(:bulk_import_configuration) { create(:bulk_import_configuration, bulk_import: bulk_import) } - let(:context) { BulkImports::Pipeline::Context.new(bulk_import_entity) } - - before do - allow(BulkImports::Pipeline::Context).to receive(:new).and_return(context) - end - - subject { described_class.new(bulk_import_entity) } - - describe '#execute' do - it 'starts the entity and run its pipelines' do - expect_to_run_pipeline BulkImports::Groups::Pipelines::GroupPipeline, context: context - expect_to_run_pipeline BulkImports::Groups::Pipelines::SubgroupEntitiesPipeline, context: context - expect_to_run_pipeline BulkImports::Groups::Pipelines::MembersPipeline, context: context - expect_to_run_pipeline BulkImports::Groups::Pipelines::LabelsPipeline, context: context - expect_to_run_pipeline BulkImports::Groups::Pipelines::MilestonesPipeline, context: context - - if Gitlab.ee? - expect_to_run_pipeline('EE::BulkImports::Groups::Pipelines::EpicsPipeline'.constantize, context: context) - expect_to_run_pipeline('EE::BulkImports::Groups::Pipelines::EpicAwardEmojiPipeline'.constantize, context: context) - expect_to_run_pipeline('EE::BulkImports::Groups::Pipelines::EpicEventsPipeline'.constantize, context: context) - expect_to_run_pipeline('EE::BulkImports::Groups::Pipelines::IterationsPipeline'.constantize, context: context) - end - - subject.execute - - expect(bulk_import_entity.reload).to be_finished - end - - context 'when failed' do - let(:bulk_import_entity) { create(:bulk_import_entity, :failed, bulk_import: bulk_import, group: group) } - - it 'does not transition entity to finished state' do - allow(bulk_import_entity).to receive(:start!) - - subject.execute - - expect(bulk_import_entity.reload).to be_failed - end - end - end - - def expect_to_run_pipeline(klass, context:) - expect_next_instance_of(klass, context) do |pipeline| - expect(pipeline).to receive(:run) - end - end -end |