diff options
Diffstat (limited to 'spec/migrations/20230504084524_remove_gitlab_import_source_spec.rb')
-rw-r--r-- | spec/migrations/20230504084524_remove_gitlab_import_source_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/migrations/20230504084524_remove_gitlab_import_source_spec.rb b/spec/migrations/20230504084524_remove_gitlab_import_source_spec.rb new file mode 100644 index 00000000000..b2442359e87 --- /dev/null +++ b/spec/migrations/20230504084524_remove_gitlab_import_source_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe RemoveGitlabImportSource, feature_category: :importers do + let(:settings) { table(:application_settings) } + let(:import_sources_with_gitlab) { %w[github git gitlab bitbucket bitbucket_server] } + let(:import_sources_without_gitlab) { %w[github git bitbucket bitbucket_server] } + + describe "#up" do + it 'removes gitlab and preserves existing valid import sources' do + record = settings.create!(import_sources: import_sources_with_gitlab) + + migrate! + + expect(record.reload.import_sources).to start_with('---') + + expect(ApplicationSetting.last.import_sources).to eq(import_sources_without_gitlab) + end + end +end |