summaryrefslogtreecommitdiff
path: root/spec/models/remote_mirror_spec.rb
diff options
context:
space:
mode:
authorLee Tickett <lee@tickett.net>2019-08-29 16:19:07 +0000
committerNick Thomas <nick@gitlab.com>2019-08-29 16:19:07 +0000
commit72390953da802311180f53b6a646d80bc1da2849 (patch)
tree46d9baeab2c3ab91bca249c446b822b5dd956531 /spec/models/remote_mirror_spec.rb
parente6869b8f6c5a589cc9807e2a797599fb7a4a968e (diff)
downloadgitlab-ce-72390953da802311180f53b6a646d80bc1da2849.tar.gz
Handle invalid mirror url
Diffstat (limited to 'spec/models/remote_mirror_spec.rb')
-rw-r--r--spec/models/remote_mirror_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/remote_mirror_spec.rb b/spec/models/remote_mirror_spec.rb
index 7edeb56efe2..f8d6e500e10 100644
--- a/spec/models/remote_mirror_spec.rb
+++ b/spec/models/remote_mirror_spec.rb
@@ -40,6 +40,13 @@ describe RemoteMirror, :mailer do
expect(remote_mirror).to be_invalid
expect(remote_mirror.errors[:url].first).to include('Requests to the local network are not allowed')
end
+
+ it 'returns a nil safe_url' do
+ remote_mirror = build(:remote_mirror, url: 'http://[0:0:0:0:ffff:123.123.123.123]/foo.git')
+
+ expect(remote_mirror.url).to eq('http://[0:0:0:0:ffff:123.123.123.123]/foo.git')
+ expect(remote_mirror.safe_url).to be_nil
+ end
end
end