diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
commit | 419c53ec62de6e97a517abd5fdd4cbde3a942a34 (patch) | |
tree | 1f43a548b46bca8a5fb8fe0c31cef1883d49c5b6 /spec/lib/bulk_imports/groups/pipelines/subgroup_entities_pipeline_spec.rb | |
parent | 1da20d9135b3ad9e75e65b028bffc921aaf8deb7 (diff) |
Add latest changes from gitlab-org/gitlab@16-5-stable-eev16.5.0-rc42
Diffstat (limited to 'spec/lib/bulk_imports/groups/pipelines/subgroup_entities_pipeline_spec.rb')
-rw-r--r-- | spec/lib/bulk_imports/groups/pipelines/subgroup_entities_pipeline_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/lib/bulk_imports/groups/pipelines/subgroup_entities_pipeline_spec.rb b/spec/lib/bulk_imports/groups/pipelines/subgroup_entities_pipeline_spec.rb index 6949ac59948..a50fe7ecd4c 100644 --- a/spec/lib/bulk_imports/groups/pipelines/subgroup_entities_pipeline_spec.rb +++ b/spec/lib/bulk_imports/groups/pipelines/subgroup_entities_pipeline_spec.rb @@ -19,7 +19,7 @@ RSpec.describe BulkImports::Groups::Pipelines::SubgroupEntitiesPipeline do }) end - describe '#run' do + describe '#run', :clean_gitlab_redis_cache do before do allow_next_instance_of(BulkImports::Groups::Extractors::SubgroupsExtractor) do |extractor| allow(extractor).to receive(:extract).and_return(extracted_data) @@ -38,6 +38,11 @@ RSpec.describe BulkImports::Groups::Pipelines::SubgroupEntitiesPipeline do expect(subgroup_entity.destination_name).to eq 'sub-group' expect(subgroup_entity.parent_id).to eq parent_entity.id end + + it 'does not create duplicate entities on rerun' do + expect { subject.run }.to change(BulkImports::Entity, :count).by(1) + expect { subject.run }.not_to change(BulkImports::Entity, :count) + end end describe '#load' do |