diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/lib/bulk_imports/features_spec.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/lib/bulk_imports/features_spec.rb')
-rw-r--r-- | spec/lib/bulk_imports/features_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/lib/bulk_imports/features_spec.rb b/spec/lib/bulk_imports/features_spec.rb new file mode 100644 index 00000000000..a92e4706bbe --- /dev/null +++ b/spec/lib/bulk_imports/features_spec.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe BulkImports::Features do + describe '.project_migration_enabled' do + let_it_be(:top_level_namespace) { create(:group) } + + context 'when bulk_import_projects feature flag is enabled' do + it 'returns true' do + stub_feature_flags(bulk_import_projects: true) + + expect(described_class.project_migration_enabled?).to eq(true) + end + + context 'when feature flag is enabled on root ancestor level' do + it 'returns true' do + stub_feature_flags(bulk_import_projects: top_level_namespace) + + expect(described_class.project_migration_enabled?(top_level_namespace.full_path)).to eq(true) + end + end + + context 'when feature flag is enabled on a different top level namespace' do + it 'returns false' do + stub_feature_flags(bulk_import_projects: top_level_namespace) + + different_namepace = create(:group) + + expect(described_class.project_migration_enabled?(different_namepace.full_path)).to eq(false) + end + end + end + + context 'when bulk_import_projects feature flag is disabled' do + it 'returns false' do + stub_feature_flags(bulk_import_projects: false) + + expect(described_class.project_migration_enabled?(top_level_namespace.full_path)).to eq(false) + end + end + end +end |