diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /spec/helpers/routing | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) | |
download | gitlab-ce-41fe97390ceddf945f3d967b8fdb3de4c66b7dea.tar.gz |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'spec/helpers/routing')
-rw-r--r-- | spec/helpers/routing/pseudonymization_helper_spec.rb | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/spec/helpers/routing/pseudonymization_helper_spec.rb b/spec/helpers/routing/pseudonymization_helper_spec.rb index d7905edb098..1221917e6b7 100644 --- a/spec/helpers/routing/pseudonymization_helper_spec.rb +++ b/spec/helpers/routing/pseudonymization_helper_spec.rb @@ -222,16 +222,26 @@ RSpec.describe ::Routing::PseudonymizationHelper do end describe 'when url has no params to mask' do - let(:root_url) { 'http://localhost/some/path' } + let(:original_url) { 'http://localhost/-/security/vulnerabilities' } + let(:request) do + double(:Request, + path_parameters: { + controller: 'security/vulnerabilities', + action: 'index' + }, + protocol: 'http', + host: 'localhost', + query_string: '', + original_fullpath: '/-/security/vulnerabilities', + original_url: original_url) + end - context 'returns root url' do - before do - controller.request.path = 'some/path' - end + before do + allow(helper).to receive(:request).and_return(request) + end - it 'masked_page_url' do - expect(subject).to eq(root_url) - end + it 'returns unchanged url' do + expect(subject).to eq(original_url) end end |