diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index bb4db01d2..dd0cd8a14 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -350,8 +350,9 @@ RSpec.describe SchemesController, type: :request do expect(CGI.unescape_html(response.body)).to match("Showing 21 to 25 of #{locations.count} locations") end - it "has correct page 1 of 2 title" do - expect(page).to have_title("#{scheme.service_name} (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") + it "has correct page 2 of 2 title" do + expected_title = CGI.escapeHTML("#{scheme.service_name} (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") + expect(page).to have_title(expected_title) end it "has pagination links" do @@ -410,7 +411,8 @@ RSpec.describe SchemesController, type: :request do end it "has correct page 1 of 2 title" do - expect(page).to have_title("#{scheme.service_name} (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") + expected_title = CGI.escapeHTML("#{scheme.service_name} (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK") + expect(page).to have_title(expected_title) end it "has pagination links" do