diff options
Diffstat (limited to 'spec/lib/gitlab/fake_application_settings_spec.rb')
-rw-r--r-- | spec/lib/gitlab/fake_application_settings_spec.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/lib/gitlab/fake_application_settings_spec.rb b/spec/lib/gitlab/fake_application_settings_spec.rb index ec32afcfb7b..b300498e898 100644 --- a/spec/lib/gitlab/fake_application_settings_spec.rb +++ b/spec/lib/gitlab/fake_application_settings_spec.rb @@ -6,27 +6,35 @@ RSpec.describe Gitlab::FakeApplicationSettings do let(:defaults) do described_class.defaults.merge( foobar: 'asdf', - 'test?' => 123 + 'test?'.to_sym => 123, + # these two settings have no default in ApplicationSettingImplementation, + # so we need to set one here + domain_denylist: [], + archive_builds_in_seconds: nil ) end let(:setting) { described_class.new(defaults) } - it 'wraps OpenStruct variables properly' do + it 'defines methods for default attributes' do expect(setting.password_authentication_enabled_for_web).to be_truthy expect(setting.signup_enabled).to be_truthy expect(setting.foobar).to eq('asdf') end - it 'defines predicate methods' do + it 'defines predicate methods for boolean properties' do expect(setting.password_authentication_enabled_for_web?).to be_truthy expect(setting.signup_enabled?).to be_truthy end - it 'does not define a predicate method' do + it 'does not define a predicate method for non-boolean properties' do expect(setting.foobar?).to be_nil end + it 'returns nil for undefined attributes' do + expect(setting.does_not_exist).to be_nil + end + it 'does not override an existing predicate method' do expect(setting.test?).to eq(123) end |