diff options
author | Markus Koller <markus-koller@gmx.ch> | 2017-11-23 13:16:14 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-11-23 13:16:14 +0000 |
commit | 257fd5713485a05460a9170190100643199a7e48 (patch) | |
tree | afaaddcdc16ac407d72b7b4c0e96d951a141c268 /spec/models/application_setting_spec.rb | |
parent | a6cafbcbe8d6802a81055c3469312f889cd73c9a (diff) | |
download | gitlab-ce-257fd5713485a05460a9170190100643199a7e48.tar.gz |
Allow password authentication to be disabled entirely
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r-- | spec/models/application_setting_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 47b7150d36f..51bf4e65e5d 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -564,4 +564,22 @@ describe ApplicationSetting do expect(setting.key_restriction_for(:foo)).to eq(described_class::FORBIDDEN_KEY_VALUE) end end + + describe '#allow_signup?' do + it 'returns true' do + expect(setting.allow_signup?).to be_truthy + end + + it 'returns false if signup is disabled' do + allow(setting).to receive(:signup_enabled?).and_return(false) + + expect(setting.allow_signup?).to be_falsey + end + + it 'returns false if password authentication is disabled for the web interface' do + allow(setting).to receive(:password_authentication_enabled_for_web?).and_return(false) + + expect(setting.allow_signup?).to be_falsey + end + end end |