diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 20:03:02 +0100 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 20:03:02 +0100 |
commit | b1f8d8a1739ff48412c8205f0007a2af8399d097 (patch) | |
tree | f7d35d158e7c9bdda6c282f916e02fe9a0d4df90 /spec/models/application_setting_spec.rb | |
parent | 52c3b8f31264230814d2ffa79d0987c1491676b3 (diff) | |
parent | 5b08d59f07fc53c1e34819fac20352119d5343e6 (diff) | |
download | gitlab-ce-b1f8d8a1739ff48412c8205f0007a2af8399d097.tar.gz |
Merge commit '5b08d59f07fc53c1e34819fac20352119d5343e6' into object-storage-ee-to-ce-backport
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r-- | spec/models/application_setting_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index fb485d0b2c6..359753b600e 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe ApplicationSetting, models: true do - let(:setting) { ApplicationSetting.create_from_defaults } +describe ApplicationSetting do + let(:setting) { described_class.create_from_defaults } it { expect(setting).to be_valid } it { expect(setting.uuid).to be_present } @@ -155,6 +155,18 @@ describe ApplicationSetting, models: true do end end + describe '.current' do + context 'redis unavailable' do + it 'returns an ApplicationSetting' do + allow(Rails.cache).to receive(:fetch).and_call_original + allow(described_class).to receive(:last).and_return(:last) + expect(Rails.cache).to receive(:fetch).with(ApplicationSetting::CACHE_KEY).and_raise(ArgumentError) + + expect(described_class.current).to eq(:last) + end + end + end + context 'restricted signup domains' do it 'sets single domain' do setting.domain_whitelist_raw = 'example.com' |