Skip to content

Commit

Permalink
Lookup fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Christine-horrocks committed Dec 20, 2018
1 parent 5153b48 commit c3ff721
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 1 addition & 9 deletions app/controllers/statutory_instruments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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('<html><body>You are being <a href="http://www.example.com/proposed-negative-statutory-instruments/VUWxOw5e">redirected</a>.</body></html>')
expect(response.body).to eq('<html><body>You are being <a href="https://www.example.com/proposed-negative-statutory-instruments/VUWxOw5e">redirected</a>.</body></html>')
end
end
end
Expand Down

0 comments on commit c3ff721

Please sign in to comment.