diff options
author | Nick Thomas <nick@gitlab.com> | 2017-08-30 23:20:00 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-08-30 23:20:00 +0300 |
commit | 29b40db58944a32db6cf1ae9906653a2e5f4be9d (patch) | |
tree | e5a8746dfbbbae708178f3e60bd6be1d41c518f8 /spec/models/application_setting_spec.rb | |
parent | eb05bdc6f589f6f0713df12582eb9f18fc4022b3 (diff) |
More review comments
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r-- | spec/models/application_setting_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index a3b6baca0a2..f921545668d 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -77,6 +77,15 @@ describe ApplicationSetting do expect(described_class::SUPPORTED_KEY_TYPES).to contain_exactly(:rsa, :dsa, :ecdsa, :ed25519) end + it 'does not allow all key types to be disabled' do + described_class::SUPPORTED_KEY_TYPES.each do |type| + setting["#{type}_key_restriction"] = described_class::FORBIDDEN_KEY_VALUE + end + + expect(setting).not_to be_valid + expect(setting.errors.messages).to have_key(:allowed_key_types) + end + where(:type) do described_class::SUPPORTED_KEY_TYPES end |