summaryrefslogtreecommitdiff
path: root/spec/models/remote_mirror_spec.rb
diff options
context:
space:
mode:
authorAndreas Kämmerle <andreas.kaemmerle@gmail.com>2018-07-03 15:30:36 +0200
committerAndreas Kämmerle <andreas.kaemmerle@gmail.com>2018-07-03 15:30:36 +0200
commite4a310113a3a5784be863151e5bcecacb23aa244 (patch)
tree79f9019b2e001a192eae3569b5746ba9c4ec9476 /spec/models/remote_mirror_spec.rb
parentd505b48806c0880ac810374973c4b9ba802c26e8 (diff)
parentc489d53b2e2eecb22f8dc7034da142221220e89f (diff)
downloadgitlab-ce-e4a310113a3a5784be863151e5bcecacb23aa244.tar.gz
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into update-template-name-via-sentence-case
# Conflicts: # .gitlab/issue_templates/Feature proposal.md
Diffstat (limited to 'spec/models/remote_mirror_spec.rb')
-rw-r--r--spec/models/remote_mirror_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/models/remote_mirror_spec.rb b/spec/models/remote_mirror_spec.rb
index 1d94abe4195..3597b080021 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
@@ -67,7 +74,9 @@ describe RemoteMirror do
mirror.update_attribute(:url, 'http://foo:baz@test.com')
- config = repo.raw_repository.rugged.config
+ config = Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ repo.raw_repository.rugged.config
+ end
expect(config["remote.#{mirror.remote_name}.url"]).to eq('http://foo:baz@test.com')
end