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 03d83ad commit 4dfca48
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions app/controllers/statutory_instruments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ 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

redirect_to redirect_url
# 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
end
end
2 changes: 1 addition & 1 deletion spec/controllers/statutory_instruments_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@


it 'redirects to statutory_instruments/:id' do
expect(response).to redirect_to(statutory_instrument_path('5trFJNih'))
expect(response).to redirect_to("https://:/statutory-instruments/5trFJNih")
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 '/statutory-instruments/lookup?source=statutoryInstrumentPaperName&id=Dorset (Electoral Changes) Order 2018'

expect(response.body).to eq('<html><body>You are being <a href="http://www.example.com/statutory-instruments/5trFJNih">redirected</a>.</body></html>')
expect(response.body).to eq('<html><body>You are being <a href="https://www.example.com/statutory-instruments/5trFJNih">redirected</a>.</body></html>')
end
end
end
Expand Down

0 comments on commit 4dfca48

Please sign in to comment.