diff options
author | Lee Tickett <lee@tickett.net> | 2019-08-29 19:19:07 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-08-29 19:19:07 +0300 |
commit | 72390953da802311180f53b6a646d80bc1da2849 (patch) | |
tree | 46d9baeab2c3ab91bca249c446b822b5dd956531 /spec/models/remote_mirror_spec.rb | |
parent | e6869b8f6c5a589cc9807e2a797599fb7a4a968e (diff) |
Handle invalid mirror url
Diffstat (limited to 'spec/models/remote_mirror_spec.rb')
-rw-r--r-- | spec/models/remote_mirror_spec.rb | 7 |
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 |