diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-10 12:08:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-10 12:08:16 +0000 |
commit | 1fa79760ad2d4bd67f5c5a27f372a7533b9b7c69 (patch) | |
tree | ffdfbd9113743831ff4f1290959a62cf6567fde5 /spec/lib/gitlab/middleware | |
parent | 82fa8a3d1e8466ef36b58604d20fcc145ea12118 (diff) | |
download | gitlab-ce-1fa79760ad2d4bd67f5c5a27f372a7533b9b7c69.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/middleware')
-rw-r--r-- | spec/lib/gitlab/middleware/go_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/lib/gitlab/middleware/go_spec.rb b/spec/lib/gitlab/middleware/go_spec.rb index 99c2a364dfc..43a489f6df0 100644 --- a/spec/lib/gitlab/middleware/go_spec.rb +++ b/spec/lib/gitlab/middleware/go_spec.rb @@ -89,6 +89,13 @@ describe Gitlab::Middleware::Go do it 'returns the full project path' do expect_response_with_path(go, enabled_protocol, project.full_path, project.default_branch) end + + context 'with an empty ssh_user' do + it 'returns the full project path' do + allow(Gitlab.config.gitlab_shell).to receive(:ssh_user).and_return('') + expect_response_with_path(go, enabled_protocol, project.full_path, project.default_branch) + end + end end context 'without access to the project' do @@ -234,7 +241,9 @@ describe Gitlab::Middleware::Go do def expect_response_with_path(response, protocol, path, branch) repository_url = case protocol when :ssh - "ssh://#{Gitlab.config.gitlab.user}@#{Gitlab.config.gitlab.host}/#{path}.git" + shell = Gitlab.config.gitlab_shell + user = "#{shell.ssh_user}@" unless shell.ssh_user.empty? + "ssh://#{user}#{shell.ssh_host}/#{path}.git" when :http, nil "http://#{Gitlab.config.gitlab.host}/#{path}.git" end |