debian-mirror-gitlab/spec/migrations/20230419105225_remove_phabricator_from_application_settings_spec.rb
2023-07-09 08:55:56 +05:30

23 lines
772 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe RemovePhabricatorFromApplicationSettings, feature_category: :importers do
let(:settings) { table(:application_settings) }
let(:import_sources_with_phabricator) { %w[phabricator github git bitbucket bitbucket_server] }
let(:import_sources_without_phabricator) { %w[github git bitbucket bitbucket_server] }
describe "#up" do
it 'removes phabricator and preserves existing valid import sources' do
record = settings.create!(import_sources: import_sources_with_phabricator)
migrate!
expect(record.reload.import_sources).to start_with('---')
expect(ApplicationSetting.last.import_sources).to eq(import_sources_without_phabricator)
end
end
end