From 79fc3f7e482eb9f7b325bfdfbffd774442eb74eb Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 24 Jun 2022 15:30:52 +0100 Subject: [PATCH] Fix more tests --- spec/requests/schemes_controller_spec.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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