Commit 906779e6 authored by Rajendra Kadam's avatar Rajendra Kadam

Add url for spec verification

parent 4c20cd08
...@@ -130,13 +130,22 @@ RSpec.describe ::Routing::PseudonymizationHelper do ...@@ -130,13 +130,22 @@ RSpec.describe ::Routing::PseudonymizationHelper do
end end
describe 'when it raises exception' do describe 'when it raises exception' do
context 'calls error tracking exception' do context 'calls error tracking' do
it 'sends error to sentry' do before do
controller.request.path = '/dashboard/issues'
controller.request.query_string = 'assignee_username=root'
allow(Rails.application.routes).to receive(:recognize_path).and_return({
controller: 'dashboard',
action: 'issues'
})
end
it 'sends error to sentry and returns nil' do
allow(helper).to receive(:mask_params).with(anything).and_raise(ActionController::RoutingError, 'Some routing error') allow(helper).to receive(:mask_params).with(anything).and_raise(ActionController::RoutingError, 'Some routing error')
expect(Gitlab::ErrorTracking).to receive(:track_exception).with( expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
ActionController::RoutingError, ActionController::RoutingError,
url: '').and_call_original url: '/dashboard/issues?assignee_username=root').and_call_original
expect(helper.masked_page_url).to be_nil expect(helper.masked_page_url).to be_nil
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment