diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-22 12:09:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-22 12:09:02 +0000 |
commit | cea25900b73fcb7029845eeca5e5a9170349f1dd (patch) | |
tree | 4d7c7c000de534569c65d71cc55e638a6a2dfbde /spec/models | |
parent | b014ff26b4416de3aa49d83483d8ce5d273c0708 (diff) | |
download | gitlab-ce-cea25900b73fcb7029845eeca5e5a9170349f1dd.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/concerns/safe_url_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/models/concerns/safe_url_spec.rb b/spec/models/concerns/safe_url_spec.rb index 3d38c05bf11..c298e56b1b1 100644 --- a/spec/models/concerns/safe_url_spec.rb +++ b/spec/models/concerns/safe_url_spec.rb @@ -26,14 +26,16 @@ RSpec.describe SafeUrl do context 'when URL contains credentials' do let(:url) { 'http://foo:bar@example.com' } - it { is_expected.to eq('http://*****:*****@example.com')} + it 'masks username and password' do + is_expected.to eq('http://*****:*****@example.com') + end - context 'when username is whitelisted' do - subject { test_class.safe_url(usernames_whitelist: usernames_whitelist) } + context 'when username is allowed' do + subject { test_class.safe_url(allowed_usernames: usernames) } - let(:usernames_whitelist) { %w[foo] } + let(:usernames) { %w[foo] } - it 'does expect the whitelisted username not to be masked' do + it 'masks the password, but not the username' do is_expected.to eq('http://foo:*****@example.com') end end |