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
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-03-19 22:30:00 +0300
committerStan Hu <stanhu@gmail.com>2016-03-20 08:47:27 +0300
commit68fa4de6e39dfa036bb74eeb01fa569c716aacdf (patch)
treeabe48e163c3f6dfe6d199410617ec71b38a0a82e /spec/helpers/projects_helper_spec.rb
parent01fe50a72513a88f2168c8c0a649661b1382a42b (diff)
Make HTTP(s) label consistent on clone bar
Sites that use http:// for the external_url should always display HTTP on the clone bar. Similarly, sites that use https:// should show HTTPS.
Diffstat (limited to 'spec/helpers/projects_helper_spec.rb')
-rw-r--r--spec/helpers/projects_helper_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index 53207767581..86cbd29830c 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -94,4 +94,23 @@ describe ProjectsHelper do
end
end
end
+
+ describe 'default_clone_protocol' do
+ describe 'using HTTP' do
+ it 'returns HTTP' do
+ expect(helper).to receive(:current_user).and_return(nil)
+
+ expect(helper.send(:default_clone_protocol)).to eq('http')
+ end
+ end
+
+ describe 'using HTTPS' do
+ it 'returns HTTPS' do
+ allow(Gitlab.config.gitlab).to receive(:protocol).and_return('https')
+ expect(helper).to receive(:current_user).and_return(nil)
+
+ expect(helper.send(:default_clone_protocol)).to eq('https')
+ end
+ end
+ end
end