diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-06-11 16:29:37 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-11 16:29:37 +0300 |
commit | 1418afc2d6e7699f08a1fc5f33b78ea847ac1451 (patch) | |
tree | 7f1cd2621237c4dd234651bd16d6e304989b731d /spec/models/remote_mirror_spec.rb | |
parent | 180dc237152d60d05e4f75d8c936e81ba783b6cd (diff) |
Avoid checking the user format in every url validation
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 1d94abe4195..4c086eeadfc 100644 --- a/spec/models/remote_mirror_spec.rb +++ b/spec/models/remote_mirror_spec.rb @@ -15,6 +15,13 @@ describe RemoteMirror do expect(remote_mirror).not_to be_valid end + + it 'does not allow url with an invalid user' do + remote_mirror = build(:remote_mirror, url: 'http://$user:password@invalid.invalid') + + expect(remote_mirror).to be_invalid + expect(remote_mirror.errors[:url].first).to include('Username needs to start with an alphanumeric character') + end end end |