From 2149a679acf0b4fe8bbbb98c6578142b5e158f50 Mon Sep 17 00:00:00 2001 From: JG Date: Thu, 28 Jul 2022 14:48:04 +0100 Subject: [PATCH] more tests fixed --- spec/features/schemes_spec.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 2cece714f..7ad8ac832 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -1,6 +1,8 @@ require "rails_helper" require_relative "schemes_helpers" +using RefinementTest + RSpec.describe "Schemes scheme Features" do include SchemesHelpers context "when viewing list of schemes" do @@ -203,7 +205,7 @@ RSpec.describe "Schemes scheme Features" do it "shows details of those locations" do locations.each do |location| expect(page).to have_content(location.id) - expect(page).to have_content(location.postcode) + expect(page).to have_content(location.postcode.formatted_postcode) expect(page).to have_content(location.units) expect(page).to have_content(location.type_of_unit) expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date)) @@ -476,7 +478,7 @@ RSpec.describe "Schemes scheme Features" do end it "displays information about the first created location" do - expect(page).to have_content "AA11AA" + expect(page).to have_content "AA1 1AA" expect(page).to have_content "Some name" expect(page).to have_content "5" expect(page).to have_content "Self-contained house" @@ -493,7 +495,7 @@ RSpec.describe "Schemes scheme Features" do it "displays information about newly created location" do click_link "Add a location" fill_in_and_save_second_location - expect(page).to have_content "XX11XX" + expect(page).to have_content "XX1 1XX" expect(page).to have_content "Other name" expect(page).to have_content "Self-contained house" end @@ -507,13 +509,13 @@ RSpec.describe "Schemes scheme Features" do end it "displays changed location" do - click_link "XX11XX" + click_link "XX1 1XX" fill_in "Postcode", with: "ZZ1 1ZZ" choose "location-mobility-type-wheelchair-user-standard-field" click_button "Save and continue" expect(page).to have_content "Locations" expect(page).to have_content "#{scheme.locations.count} location" - expect(page).to have_content "ZZ11ZZ" + expect(page).to have_content "ZZ1 1ZZ" end end @@ -723,7 +725,7 @@ RSpec.describe "Schemes scheme Features" do context "when I click to change location name" do before do - click_link(location.postcode) + click_link(location.postcode.formatted_postcode) end it "shows available fields to edit" do