From e9a0196a7dc8d4591c4d0ca37e3529efbd7aba42 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Thu, 12 Feb 2026 17:16:05 +0000 Subject: [PATCH 1/2] CLDC-4155: Update reason for leaving hint text (#3167) --- config/locales/forms/2026/lettings/household_situation.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/forms/2026/lettings/household_situation.en.yml b/config/locales/forms/2026/lettings/household_situation.en.yml index 1d3e135c7..02438edcc 100644 --- a/config/locales/forms/2026/lettings/household_situation.en.yml +++ b/config/locales/forms/2026/lettings/household_situation.en.yml @@ -35,7 +35,7 @@ en: reason: check_answer_label: "Reason for leaving last settled home" check_answer_prompt: "" - hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously." + hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living immediately before that period." question_text: "What is the tenant’s main reason for the household leaving their last settled home?" reasonother: check_answer_label: "" From 7e5acec0658aa1e3335045477afcc1d9a03ffcb1 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Fri, 13 Feb 2026 10:12:22 +0000 Subject: [PATCH 2/2] CLDC-NONE: Fix flaky test (#3173) * CLDC-NONE: Fix flaky test * CLDC-NONE: Remove timecop from flaky test --- spec/features/bulk_upload_sales_logs_spec.rb | 30 +++++++------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/spec/features/bulk_upload_sales_logs_spec.rb b/spec/features/bulk_upload_sales_logs_spec.rb index 1816b6720..0899b4e44 100644 --- a/spec/features/bulk_upload_sales_logs_spec.rb +++ b/spec/features/bulk_upload_sales_logs_spec.rb @@ -1,7 +1,10 @@ require "rails_helper" RSpec.describe "Bulk upload sales log" do + include CollectionTimeHelper + let(:user) { create(:user) } + let(:crossover_period) { nil } let(:stub_file_upload) do vcap_services = { "aws-s3-bucket" => {} } @@ -17,17 +20,12 @@ RSpec.describe "Bulk upload sales log" do before do stub_file_upload sign_in user + allow(FormHandler.instance).to receive(:sales_in_crossover_period?).and_return(crossover_period) end # rubocop:disable RSpec/AnyInstance context "when during crossover period" do - before do - Timecop.freeze(2024, 5, 1) - end - - after do - Timecop.return - end + let(:crossover_period) { true } it "shows journey with year option" do visit("/sales-logs") @@ -38,15 +36,15 @@ RSpec.describe "Bulk upload sales log" do click_button("Continue") expect(page).to have_content("You must select a collection period to upload for") - choose("2024 to 2025") + choose("#{current_collection_start_year} to #{current_collection_end_year}") click_button("Continue") click_link("Back") - expect(page.find_field("form-year-2024-field")).to be_checked + expect(page.find_field("form-year-#{current_collection_start_year}-field")).to be_checked click_button("Continue") - expect(page).to have_content("Upload sales logs in bulk (2024 to 2025)") + expect(page).to have_content("Upload sales logs in bulk (#{current_collection_start_year} to #{current_collection_end_year})") click_button("Continue") expect(page).to have_content("Upload your file") @@ -80,7 +78,7 @@ RSpec.describe "Bulk upload sales log" do expect(page).to have_content("Which year") click_button("Continue") click_button("Continue") - choose("2024 to 2025") + choose("#{current_collection_start_year} to #{current_collection_end_year}") click_button("Continue") click_button("Continue") @@ -95,20 +93,14 @@ RSpec.describe "Bulk upload sales log" do # rubocop:enable RSpec/AnyInstance context "when not in crossover period" do - before do - Timecop.freeze(2025, 2, 1) - end - - after do - Timecop.return - end + let(:crossover_period) { false } it "shows journey without year option" do visit("/sales-logs") expect(page).to have_link("Upload sales logs in bulk") click_link("Upload sales logs in bulk") - expect(page).to have_content("Upload sales logs in bulk (2024 to 2025)") + expect(page).to have_content("Upload sales logs in bulk (#{current_collection_start_year} to #{current_collection_end_year})") click_button("Continue") expect(page).to have_content("Upload your file")