summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 21:09:21 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 21:09:21 +0000
commit87af6f2e0590af0ed1bb3e5de1bb5d21855a94d2 (patch)
tree2abe2661b10cf6281bc03855b3053a072c64fbbf /spec/helpers
parentc43ba2677f41ad0b5fc6f3af6baf4266c70dfcb3 (diff)
downloadgitlab-ce-87af6f2e0590af0ed1bb3e5de1bb5d21855a94d2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/submodule_helper_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/helpers/submodule_helper_spec.rb b/spec/helpers/submodule_helper_spec.rb
index 7db45c05cb5..db0836c8550 100644
--- a/spec/helpers/submodule_helper_spec.rb
+++ b/spec/helpers/submodule_helper_spec.rb
@@ -81,6 +81,33 @@ describe SubmoduleHelper do
end
end
+ context 'submodule on gist.github.com' do
+ it 'detects ssh' do
+ stub_url('git@gist.github.com:gitlab-org/gitlab-foss.git')
+ is_expected.to eq(['https://gist.github.com/gitlab-org/gitlab-foss', 'https://gist.github.com/gitlab-org/gitlab-foss/hash'])
+ end
+
+ it 'detects http' do
+ stub_url('http://gist.github.com/gitlab-org/gitlab-foss.git')
+ is_expected.to eq(['https://gist.github.com/gitlab-org/gitlab-foss', 'https://gist.github.com/gitlab-org/gitlab-foss/hash'])
+ end
+
+ it 'detects https' do
+ stub_url('https://gist.github.com/gitlab-org/gitlab-foss.git')
+ is_expected.to eq(['https://gist.github.com/gitlab-org/gitlab-foss', 'https://gist.github.com/gitlab-org/gitlab-foss/hash'])
+ end
+
+ it 'handles urls with no .git on the end' do
+ stub_url('http://gist.github.com/gitlab-org/gitlab-foss')
+ is_expected.to eq(['https://gist.github.com/gitlab-org/gitlab-foss', 'https://gist.github.com/gitlab-org/gitlab-foss/hash'])
+ end
+
+ it 'returns original with non-standard url' do
+ stub_url('http://gist.github.com/another/gitlab-org/gitlab-foss.git')
+ is_expected.to eq([repo.submodule_url_for, nil])
+ end
+ end
+
context 'submodule on github.com' do
it 'detects ssh' do
stub_url('git@github.com:gitlab-org/gitlab-foss.git')