diff options
author | David Turner <novalis@novalis.org> | 2017-04-18 01:44:16 -0400 |
---|---|---|
committer | David Turner <novalis@novalis.org> | 2017-04-21 10:54:31 -0400 |
commit | 040062cc8ada4e242b27e6e6fbddcf8f27d5d0c8 (patch) | |
tree | 22e357db2d63c4672f85040fd4211c817ac316ef /spec | |
parent | bbd83376d625b8d9cb73cbc83c3c0eb71b1abf32 (diff) | |
download | gitlab-ce-040062cc8ada4e242b27e6e6fbddcf8f27d5d0c8.tar.gz |
submodule_links: handle urls that don't end with .git
Signed-off-by: David Turner <novalis@novalis.org>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/submodule_helper_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/helpers/submodule_helper_spec.rb b/spec/helpers/submodule_helper_spec.rb index 28b8def331d..345bc33a67b 100644 --- a/spec/helpers/submodule_helper_spec.rb +++ b/spec/helpers/submodule_helper_spec.rb @@ -70,10 +70,12 @@ describe SubmoduleHelper do expect(submodule_links(submodule_item)).to eq(['https://github.com/gitlab-org/gitlab-ce', 'https://github.com/gitlab-org/gitlab-ce/tree/hash']) end - it 'returns original with non-standard url' do + it 'handles urls with no .git on the end' do stub_url('http://github.com/gitlab-org/gitlab-ce') - expect(submodule_links(submodule_item)).to eq([repo.submodule_url_for, nil]) + expect(submodule_links(submodule_item)).to eq(['https://github.com/gitlab-org/gitlab-ce', 'https://github.com/gitlab-org/gitlab-ce/tree/hash']) + end + it 'returns original with non-standard url' do stub_url('http://github.com/another/gitlab-org/gitlab-ce.git') expect(submodule_links(submodule_item)).to eq([repo.submodule_url_for, nil]) end @@ -95,10 +97,12 @@ describe SubmoduleHelper do expect(submodule_links(submodule_item)).to eq(['https://gitlab.com/gitlab-org/gitlab-ce', 'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash']) end - it 'returns original with non-standard url' do + it 'handles urls with no .git on the end' do stub_url('http://gitlab.com/gitlab-org/gitlab-ce') - expect(submodule_links(submodule_item)).to eq([repo.submodule_url_for, nil]) + expect(submodule_links(submodule_item)).to eq(['https://gitlab.com/gitlab-org/gitlab-ce', 'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash']) + end + it 'returns original with non-standard url' do stub_url('http://gitlab.com/another/gitlab-org/gitlab-ce.git') expect(submodule_links(submodule_item)).to eq([repo.submodule_url_for, nil]) end |