diff options
Diffstat (limited to 'spec/migrations/reseed_repository_storages_weighted_spec.rb')
-rw-r--r-- | spec/migrations/reseed_repository_storages_weighted_spec.rb | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/spec/migrations/reseed_repository_storages_weighted_spec.rb b/spec/migrations/reseed_repository_storages_weighted_spec.rb deleted file mode 100644 index d7efff3dfba..00000000000 --- a/spec/migrations/reseed_repository_storages_weighted_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ReseedRepositoryStoragesWeighted do - let(:storages) { { "foo" => {}, "baz" => {} } } - let(:application_settings) do - table(:application_settings).tap do |klass| - klass.class_eval do - serialize :repository_storages - end - end - end - - before do - allow(Gitlab.config.repositories).to receive(:storages).and_return(storages) - end - - let(:repository_storages) { ["foo"] } - let!(:application_setting) { application_settings.create!(repository_storages: repository_storages) } - - context 'with empty repository_storages_weighted column' do - it 'populates repository_storages_weighted properly' do - migrate! - - expect(application_settings.find(application_setting.id).repository_storages_weighted).to eq({ "foo" => 100, "baz" => 0 }) - end - end - - context 'with already-populated repository_storages_weighted column' do - let(:existing_weights) { { "foo" => 100, "baz" => 50 } } - - it 'does not change repository_storages_weighted properly' do - application_setting.repository_storages_weighted = existing_weights - application_setting.save! - - migrate! - - expect(application_settings.find(application_setting.id).repository_storages_weighted).to eq(existing_weights) - end - end -end |