diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-07-25 18:43:52 +0000 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-07-25 18:43:52 +0000 |
commit | 64f3324096e759b599682ef7ce5bdee75c9701b2 (patch) | |
tree | d365bc6bfb29c7a7bd209963c961c99c7a348606 /spec/migrations | |
parent | 2179c7cd4280f58d32c0cd601d4bab612f106c47 (diff) | |
download | gitlab-ce-64f3324096e759b599682ef7ce5bdee75c9701b2.tar.gz |
Add default for outbound_local_requests_whitelist
It needs to default to an empty array logically.
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb b/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb new file mode 100644 index 00000000000..232f6f090c3 --- /dev/null +++ b/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'spec_helper' +require Rails.root.join('db', 'migrate', '20190725012225_change_outbound_local_requests_whitelist_default.rb') + +describe ChangeOutboundLocalRequestsWhitelistDefault, :migration do + let(:application_settings) { table(:application_settings) } + + it 'defaults to empty array' do + setting = application_settings.create! + setting_with_value = application_settings.create!(outbound_local_requests_whitelist: '{a,b}') + + expect(application_settings.where(outbound_local_requests_whitelist: nil).count).to eq(1) + + migrate! + + expect(application_settings.where(outbound_local_requests_whitelist: nil).count).to eq(0) + expect(setting.reload.outbound_local_requests_whitelist).to eq([]) + expect(setting_with_value.reload.outbound_local_requests_whitelist).to eq(%w[a b]) + end +end |