diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-03 01:25:47 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-03 01:25:47 +0000 |
commit | 668deeaee9401d67c908d8c5c46c8537b408e44f (patch) | |
tree | f50ece8988d839cedf6166447df6e09b7633cd09 /spec/models | |
parent | 3ebb815a38ba86e4133557f77b94c292c8fc2e7e (diff) | |
parent | a527fab1f5d565c804bd5de5300dfcbb88376f8d (diff) | |
download | gitlab-ce-668deeaee9401d67c908d8c5c46c8537b408e44f.tar.gz |
Merge branch '24921-hide-prompt-to-add-ssh-key-if-ssh-protocol-is-disabled' into 'master'
If SSH prototol is disabled don't say the user requires SSH keys
Closes #24921
See merge request !7840
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/user_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 14c891994d0..2244803f90c 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -575,6 +575,23 @@ describe User, models: true do end end end + + describe '#require_ssh_key?' do + protocol_and_expectation = { + 'http' => false, + 'ssh' => true, + '' => true, + } + + protocol_and_expectation.each do |protocol, expected| + it "has correct require_ssh_key?" do + stub_application_setting(enabled_git_access_protocol: protocol) + user = build(:user) + + expect(user.require_ssh_key?).to eq(expected) + end + end + end end describe '.find_by_any_email' do |