diff options
author | Rémy Coutable <remy@rymai.me> | 2017-05-30 14:18:58 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-05-30 14:18:58 +0200 |
commit | bf4cc9e1f3ca6e4d828eb2bc1ca22d4f350c9dc6 (patch) | |
tree | 2c402a7f088b7e0b3d3f7dd1903b8420f5dc7cf3 /spec/lib/gitlab/url_sanitizer_spec.rb | |
parent | fd376b3ed4de310f8e599cbbeb5c18e5a31c188c (diff) | |
download | gitlab-ce-bf4cc9e1f3ca6e4d828eb2bc1ca22d4f350c9dc6.tar.gz |
Don't allow to pass a user to ProjectWiki#http_url_to_repo
This partially reverts be25bbc4d2c7e3d5cf3da6f51cb7f7355295ef52.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/lib/gitlab/url_sanitizer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/url_sanitizer_spec.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/spec/lib/gitlab/url_sanitizer_spec.rb b/spec/lib/gitlab/url_sanitizer_spec.rb index fc144a2556a..6bce724a3f6 100644 --- a/spec/lib/gitlab/url_sanitizer_spec.rb +++ b/spec/lib/gitlab/url_sanitizer_spec.rb @@ -62,11 +62,6 @@ describe Gitlab::UrlSanitizer, lib: true do end end - describe '.http_credentials_for_user' do - it { expect(described_class.http_credentials_for_user(user)).to eq({ user: 'john.doe' }) } - it { expect(described_class.http_credentials_for_user('foo')).to eq({}) } - end - describe '#sanitized_url' do it { expect(url_sanitizer.sanitized_url).to eq("https://github.com/me/project.git") } end @@ -76,7 +71,7 @@ describe Gitlab::UrlSanitizer, lib: true do context 'when user is given to #initialize' do let(:url_sanitizer) do - described_class.new("https://github.com/me/project.git", credentials: described_class.http_credentials_for_user(user)) + described_class.new("https://github.com/me/project.git", credentials: { user: user.username }) end it { expect(url_sanitizer.credentials).to eq({ user: 'john.doe' }) } @@ -94,7 +89,7 @@ describe Gitlab::UrlSanitizer, lib: true do context 'when user is given to #initialize' do let(:url_sanitizer) do - described_class.new("https://github.com/me/project.git", credentials: described_class.http_credentials_for_user(user)) + described_class.new("https://github.com/me/project.git", credentials: { user: user.username }) end it { expect(url_sanitizer.full_url).to eq("https://john.doe@github.com/me/project.git") } |