diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-05 23:11:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-05 23:11:43 +0000 |
commit | 13d327df4f3c52505bf8ec1144f2dedb6a351ad6 (patch) | |
tree | 546e42fe159cde302b5e4d0b923d399e79bfbf71 /spec/models | |
parent | 9a70fcd2e277721bbe7b9a0c92ed925ddea201b6 (diff) | |
download | gitlab-ce-13d327df4f3c52505bf8ec1144f2dedb6a351ad6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-9-stable-ee
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/application_setting_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 9a4dd2c799b..5658057f588 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -650,6 +650,32 @@ RSpec.describe ApplicationSetting do end end + describe '#asset_proxy_whitelist' do + context 'when given an Array' do + it 'sets the domains and adds current running host' do + setting.asset_proxy_whitelist = ['example.com', 'assets.example.com'] + expect(setting.asset_proxy_whitelist).to eq(['example.com', 'assets.example.com', 'localhost']) + end + end + + context 'when given a String' do + it 'sets multiple domains with spaces' do + setting.asset_proxy_whitelist = 'example.com *.example.com' + expect(setting.asset_proxy_whitelist).to eq(['example.com', '*.example.com', 'localhost']) + end + + it 'sets multiple domains with newlines and a space' do + setting.asset_proxy_whitelist = "example.com\n *.example.com" + expect(setting.asset_proxy_whitelist).to eq(['example.com', '*.example.com', 'localhost']) + end + + it 'sets multiple domains with commas' do + setting.asset_proxy_whitelist = "example.com, *.example.com" + expect(setting.asset_proxy_whitelist).to eq(['example.com', '*.example.com', 'localhost']) + end + end + end + describe '#asset_proxy_allowlist' do context 'when given an Array' do it 'sets the domains and adds current running host' do |