summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-05-29 17:29:54 +0000
committerTimothy Andrew <mail@timothyandrew.net>2017-06-08 10:03:06 +0000
commitd27721e97315ef9de9003bc5d620046189dc9b09 (patch)
treefd45beb1d83d399f80a2a4a9956b2238acc81e4b /spec
parentc8175323e8c198177fdf10e4b4e5d34166a96514 (diff)
downloadgitlab-ce-d27721e97315ef9de9003bc5d620046189dc9b09.tar.gz
Merge branch 'sh-fix-submodules-trailing-spaces' into 'master'
Strip trailing whitespaces in submodule URLs Closes #33018 See merge request !11753
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/submodule_helper_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/helpers/submodule_helper_spec.rb b/spec/helpers/submodule_helper_spec.rb
index 9da33792659..fa9945f3d73 100644
--- a/spec/helpers/submodule_helper_spec.rb
+++ b/spec/helpers/submodule_helper_spec.rb
@@ -102,6 +102,11 @@ 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 'handles urls with trailing whitespace' do
+ stub_url('http://gitlab.com/gitlab-org/gitlab-ce.git ')
+ 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])