From e2350f99887a1f2792dfc5ad161e654ddd9592e4 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 2 May 2023 13:40:01 +0100 Subject: [PATCH] Wording in tests and time test --- .../check_answers_summary_list_card_component_spec.rb | 8 ++++++++ spec/requests/form_controller_spec.rb | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/components/check_answers_summary_list_card_component_spec.rb b/spec/components/check_answers_summary_list_card_component_spec.rb index 4afe0fbc2..842f55e14 100644 --- a/spec/components/check_answers_summary_list_card_component_spec.rb +++ b/spec/components/check_answers_summary_list_card_component_spec.rb @@ -68,6 +68,14 @@ RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do let(:subsection) { log.form.get_subsection(subsection_id) } let(:questions) { subsection.applicable_questions(log) } + around do |example| + Timecop.freeze(Time.zone.local(2023, 5, 1)) + Singleton.__init__(FormHandler) + example.run + Timecop.return + Singleton.__init__(FormHandler) + end + it "renders a summary list card including question numbers for the answers to those questions" do expect(rendered).to have_content(questions.first.answer_label(log)) expect(rendered).to have_content("Q32 - Lead tenant’s age") diff --git a/spec/requests/form_controller_spec.rb b/spec/requests/form_controller_spec.rb index 42985ad2b..5d9042c7c 100644 --- a/spec/requests/form_controller_spec.rb +++ b/spec/requests/form_controller_spec.rb @@ -569,7 +569,7 @@ RSpec.describe FormController, type: :request do let(:referrer) { "/lettings-logs/#{lettings_log.id}/#{page_id.dasherize}?referrer=interruption_screen" } it "routes to the soft validation page" do - expect(response.body).to include("Make sure these answers are all correct") + expect(response.body).to include("Make sure these answers are correct:") end end @@ -578,7 +578,7 @@ RSpec.describe FormController, type: :request do it "skips the soft validation page" do follow_redirect! - expect(response.body).not_to include("Make sure these answers are all correct") + expect(response.body).not_to include("Make sure these answers are correct:") end end end