summaryrefslogtreecommitdiff
path: root/spec/helpers/routing
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/routing')
-rw-r--r--spec/helpers/routing/pseudonymization_helper_spec.rb26
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