Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2016-12-03 04:25:47 +0300
committerSean McGivern <sean@mcgivern.me.uk>2016-12-03 04:25:47 +0300
commit668deeaee9401d67c908d8c5c46c8537b408e44f (patch)
treef50ece8988d839cedf6166447df6e09b7633cd09 /spec
parent3ebb815a38ba86e4133557f77b94c292c8fc2e7e (diff)
parenta527fab1f5d565c804bd5de5300dfcbb88376f8d (diff)
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')
-rw-r--r--spec/models/user_spec.rb17
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