diff --git a/app/controllers/place_controller.rb b/app/controllers/place_controller.rb index 6d336268b6..a9dfd869d6 100644 --- a/app/controllers/place_controller.rb +++ b/app/controllers/place_controller.rb @@ -55,7 +55,7 @@ def location_error return LocationError.new(INVALID_POSTCODE) unless postcode_provided? return LocationError.new(INVALID_POSTCODE) if places_manager_response.invalid_postcode? - LocationError.new(NO_LOCATION) if places_manager_response.places_not_found? + LocationError.new(NO_LOCATION) if places_manager_response.places_not_found? && !places_manager_response.addresses_returned? end def places_manager_response diff --git a/app/views/place/_place.html.erb b/app/views/place/_place.html.erb index 2b54ad8fea..4950d41513 100644 --- a/app/views/place/_place.html.erb +++ b/app/views/place/_place.html.erb @@ -1,3 +1,7 @@ +<% + content_for :title, "#{publication.title}: #{t('formats.local_transaction.search_result')} - GOV.UK" +%> + <% places.each do |place| %>
  • diff --git a/app/views/place/multiple_authorities.html.erb b/app/views/place/multiple_authorities.html.erb index 5b53de7f48..d7edd94f14 100644 --- a/app/views/place/multiple_authorities.html.erb +++ b/app/views/place/multiple_authorities.html.erb @@ -1,3 +1,5 @@ +<% content_for :title, "#{publication.title}: #{t('formats.local_transaction.select_address').downcase} - GOV.UK" %> + <%= render layout: "shared/base_page", locals: { title: publication.title, publication: publication, diff --git a/test/integration/place_test.rb b/test/integration/place_test.rb index 12a89c846b..98ed41b0fe 100644 --- a/test/integration/place_test.rb +++ b/test/integration/place_test.rb @@ -130,6 +130,10 @@ class PlacesTest < ActionDispatch::IntegrationTest assert_current_url "/passport-interview-office" end + should "include the search result text in the page title" do + assert page.has_title?("Find a passport interview office: #{I18n.t('formats.local_transaction.search_result')} - GOV.UK", exact: true) + end + should "not display an error message" do assert page.has_no_content?("Please enter a valid full UK postcode.") end @@ -329,6 +333,10 @@ class PlacesTest < ActionDispatch::IntegrationTest click_on "Find" end + should "include the select address text in the page title" do + assert page.has_title?("Find a passport interview office: #{I18n.t('formats.local_transaction.select_address').downcase} - GOV.UK", exact: true) + end + should "display the address chooser" do assert page.has_content?("House 1") end