From b46d5b13ecb8e0c0793fa433bff7f49cb0612760 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Fri, 8 Sep 2017 15:48:10 +0100 Subject: Backport more EE changes to Gitlab::UrlSanitizer --- spec/lib/gitlab/url_sanitizer_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec/lib/gitlab/url_sanitizer_spec.rb') diff --git a/spec/lib/gitlab/url_sanitizer_spec.rb b/spec/lib/gitlab/url_sanitizer_spec.rb index fdc3990132a..59c28431e1e 100644 --- a/spec/lib/gitlab/url_sanitizer_spec.rb +++ b/spec/lib/gitlab/url_sanitizer_spec.rb @@ -174,4 +174,13 @@ describe Gitlab::UrlSanitizer do end end end + + context 'when credentials contains special chars' do + it 'should parse the URL without errors' do + url_sanitizer = described_class.new("https://foo:b?r@github.com/me/project.git") + + expect(url_sanitizer.sanitized_url).to eq("https://github.com/me/project.git") + expect(url_sanitizer.full_url).to eq("https://foo:b?r@github.com/me/project.git") + end + end end -- cgit v1.2.3