From c3ff721bca7d6f22add1ae5dccf7d5e1a1bad587 Mon Sep 17 00:00:00 2001 From: Christine-horrocks Date: Thu, 20 Dec 2018 14:12:36 +0000 Subject: [PATCH] Lookup fix --- ...oposed_negative_statutory_instruments_controller.rb | 2 +- app/controllers/statutory_instruments_controller.rb | 10 +--------- ...d_negative_statutory_instruments_controller_spec.rb | 2 +- ...d_negative_statutory_instruments_controller_spec.rb | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app/controllers/proposed_negative_statutory_instruments_controller.rb b/app/controllers/proposed_negative_statutory_instruments_controller.rb index 5e9e082d..352ef344 100644 --- a/app/controllers/proposed_negative_statutory_instruments_controller.rb +++ b/app/controllers/proposed_negative_statutory_instruments_controller.rb @@ -32,6 +32,6 @@ def lookup @proposed_negative_statutory_instrument = FilterHelper.filter(@api_request, 'ProposedNegativeStatutoryInstrumentPaper') @proposed_negative_statutory_instrument = @proposed_negative_statutory_instrument.first - redirect_to proposed_negative_statutory_instrument_path(@proposed_negative_statutory_instrument.graph_id) + redirect_to :action => 'show', 'proposed_negative_statutory_instrument_id' => @proposed_negative_statutory_instrument.graph_id end end diff --git a/app/controllers/statutory_instruments_controller.rb b/app/controllers/statutory_instruments_controller.rb index aaabff16..2672d935 100644 --- a/app/controllers/statutory_instruments_controller.rb +++ b/app/controllers/statutory_instruments_controller.rb @@ -32,14 +32,6 @@ def lookup @statutory_instrument = FilterHelper.filter(@api_request, 'StatutoryInstrumentPaper') @statutory_instrument = @statutory_instrument.first -# redirect_url = URI.parse(statutory_instrument_path(@statutory_instrument.graph_id)) -# redirect_url.port = nil -# redirect_url = redirect_url.to_s -# -# p '_________________' -# p redirect_url -# p URI.parse(statutory_instrument_path(@statutory_instrument.graph_id )) -# p '_________________' - redirect_to :action => "show", "statutory_instrument_id" => @statutory_instrument.graph_id + redirect_to :action => 'show', 'statutory_instrument_id' => @statutory_instrument.graph_id end end diff --git a/spec/controllers/proposed_negative_statutory_instruments_controller_spec.rb b/spec/controllers/proposed_negative_statutory_instruments_controller_spec.rb index 88313cb7..e171746a 100644 --- a/spec/controllers/proposed_negative_statutory_instruments_controller_spec.rb +++ b/spec/controllers/proposed_negative_statutory_instruments_controller_spec.rb @@ -125,7 +125,7 @@ end it 'redirects to proposed_negative_statutory_instruments/:id' do - expect(response).to redirect_to(proposed_negative_statutory_instrument_path('VUWxOw5e')) + expect(response).to redirect_to('https://:/proposed-negative-statutory-instruments/VUWxOw5e') end end end diff --git a/spec/integration/controllers/proposed_negative_statutory_instruments_controller_spec.rb b/spec/integration/controllers/proposed_negative_statutory_instruments_controller_spec.rb index d4a40f82..53215d72 100644 --- a/spec/integration/controllers/proposed_negative_statutory_instruments_controller_spec.rb +++ b/spec/integration/controllers/proposed_negative_statutory_instruments_controller_spec.rb @@ -40,7 +40,7 @@ it 'renders expected JSON output' do get '/proposed-negative-statutory-instruments/lookup?source=proposedNegativeStatutoryInstrumentPaperName&id=Animal Breeding (Amendment) (EU Exit) Regulations 2018' - expect(response.body).to eq('You are being redirected.') + expect(response.body).to eq('You are being redirected.') end end end