From 26cb47ee6ec5d19a7e67e3e1a269d4a85253f12d Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Wed, 11 Feb 2026 12:43:33 +0000 Subject: [PATCH] CLDC-1980: reduce number of questions changed to first per section --- .../sales/questions/deposit_value_check.rb | 1 - app/models/form/sales/questions/prevown.rb | 1 - app/models/form/sales/questions/prevshared.rb | 1 - app/models/form/sales/questions/savings.rb | 1 - app/models/form/sales/questions/savings_nk.rb | 1 - .../sales/questions/savings_value_check.rb | 1 - .../questions/deposit_value_check_spec.rb | 8 -------- .../form/sales/questions/prevown_spec.rb | 20 ------------------- .../form/sales/questions/prevshared_spec.rb | 20 ------------------- .../form/sales/questions/savings_nk_spec.rb | 20 ------------------- .../form/sales/questions/savings_spec.rb | 20 ------------------- .../questions/savings_value_check_spec.rb | 8 -------- 12 files changed, 102 deletions(-) diff --git a/app/models/form/sales/questions/deposit_value_check.rb b/app/models/form/sales/questions/deposit_value_check.rb index eafd88ab6..03f94f295 100644 --- a/app/models/form/sales/questions/deposit_value_check.rb +++ b/app/models/form/sales/questions/deposit_value_check.rb @@ -19,6 +19,5 @@ class Form::Sales::Questions::DepositValueCheck < ::Form::Question ], } @check_answers_card_number = 0 unless form.start_year_2026_or_later? - @check_answers_card_title = "All buyers" if form.start_year_2026_or_later? end end diff --git a/app/models/form/sales/questions/prevown.rb b/app/models/form/sales/questions/prevown.rb index 85a3407b0..25f852bdc 100644 --- a/app/models/form/sales/questions/prevown.rb +++ b/app/models/form/sales/questions/prevown.rb @@ -5,7 +5,6 @@ class Form::Sales::Questions::Prevown < ::Form::Question @copy_key = "sales.income_benefits_and_savings.prevown.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @type = "radio" @answer_options = ANSWER_OPTIONS - @check_answers_card_title = "All buyers" if form.start_year_2026_or_later? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/prevshared.rb b/app/models/form/sales/questions/prevshared.rb index 390d8d9a0..f4ca3b1ff 100644 --- a/app/models/form/sales/questions/prevshared.rb +++ b/app/models/form/sales/questions/prevshared.rb @@ -4,7 +4,6 @@ class Form::Sales::Questions::Prevshared < ::Form::Question @id = "prevshared" @type = "radio" @answer_options = ANSWER_OPTIONS - @check_answers_card_title = "All buyers" if form.start_year_2026_or_later? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/savings.rb b/app/models/form/sales/questions/savings.rb index 5d5dd032c..6a6cb3893 100644 --- a/app/models/form/sales/questions/savings.rb +++ b/app/models/form/sales/questions/savings.rb @@ -8,7 +8,6 @@ class Form::Sales::Questions::Savings < ::Form::Question @prefix = "£" @step = 10 @min = 0 - @check_answers_card_title = "All buyers" if form.start_year_2026_or_later? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @strip_commas = true end diff --git a/app/models/form/sales/questions/savings_nk.rb b/app/models/form/sales/questions/savings_nk.rb index 02eb8b0fe..6aaf6de5e 100644 --- a/app/models/form/sales/questions/savings_nk.rb +++ b/app/models/form/sales/questions/savings_nk.rb @@ -5,7 +5,6 @@ class Form::Sales::Questions::SavingsNk < ::Form::Question @copy_key = "sales.income_benefits_and_savings.savings.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}.savingsnk" @type = "radio" @answer_options = ANSWER_OPTIONS - @check_answers_card_title = "All buyers" if form.start_year_2026_or_later? @conditional_for = { "savings" => [0], } diff --git a/app/models/form/sales/questions/savings_value_check.rb b/app/models/form/sales/questions/savings_value_check.rb index 0c513544a..1b7ea6a7c 100644 --- a/app/models/form/sales/questions/savings_value_check.rb +++ b/app/models/form/sales/questions/savings_value_check.rb @@ -19,6 +19,5 @@ class Form::Sales::Questions::SavingsValueCheck < ::Form::Question ], } @check_answers_card_number = 0 unless form.start_year_2026_or_later? - @check_answers_card_title = "All buyers" if form.start_year_2026_or_later? end end diff --git a/spec/models/form/sales/questions/deposit_value_check_spec.rb b/spec/models/form/sales/questions/deposit_value_check_spec.rb index d3cdbd3e0..2f705bfbd 100644 --- a/spec/models/form/sales/questions/deposit_value_check_spec.rb +++ b/spec/models/form/sales/questions/deposit_value_check_spec.rb @@ -39,10 +39,6 @@ RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do it "has check_answers_card_number set to 0" do expect(question.check_answers_card_number).to eq(0) end - - it "does not have a check_answers_card_title" do - expect(question.check_answers_card_title).to be_nil - end end context "when in 2026", { year: 26 } do @@ -53,10 +49,6 @@ RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do it "does not have a check_answers_card_number" do expect(question.check_answers_card_number).to be_nil end - - it "has check_answers_card_title set to 'All buyers'" do - expect(question.check_answers_card_title).to eq("All buyers") - end end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/prevown_spec.rb b/spec/models/form/sales/questions/prevown_spec.rb index bbeed65a0..43e71a330 100644 --- a/spec/models/form/sales/questions/prevown_spec.rb +++ b/spec/models/form/sales/questions/prevown_spec.rb @@ -33,26 +33,6 @@ RSpec.describe Form::Sales::Questions::Prevown, type: :model do expect(question.derived?(nil)).to be false end - context "when in 2025", { year: 25 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(false) - end - - it "does not have a check_answers_card_title" do - expect(question.check_answers_card_title).to be_nil - end - end - - context "when in 2026", { year: 26 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(true) - end - - it "has check_answers_card_title set to 'All buyers'" do - expect(question.check_answers_card_title).to eq("All buyers") - end - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/prevshared_spec.rb b/spec/models/form/sales/questions/prevshared_spec.rb index 2540a46e2..1682ae208 100644 --- a/spec/models/form/sales/questions/prevshared_spec.rb +++ b/spec/models/form/sales/questions/prevshared_spec.rb @@ -32,26 +32,6 @@ RSpec.describe Form::Sales::Questions::Prevshared, type: :model do expect(question.derived?(nil)).to be false end - context "when in 2025", { year: 25 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(false) - end - - it "does not have a check_answers_card_title" do - expect(question.check_answers_card_title).to be_nil - end - end - - context "when in 2026", { year: 26 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(true) - end - - it "has check_answers_card_title set to 'All buyers'" do - expect(question.check_answers_card_title).to eq("All buyers") - end - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/savings_nk_spec.rb b/spec/models/form/sales/questions/savings_nk_spec.rb index 0d0e27bbf..536c5af57 100644 --- a/spec/models/form/sales/questions/savings_nk_spec.rb +++ b/spec/models/form/sales/questions/savings_nk_spec.rb @@ -32,26 +32,6 @@ RSpec.describe Form::Sales::Questions::SavingsNk, type: :model do expect(question.derived?(nil)).to be false end - context "when in 2025", { year: 25 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(false) - end - - it "does not have a check_answers_card_title" do - expect(question.check_answers_card_title).to be_nil - end - end - - context "when in 2026", { year: 26 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(true) - end - - it "has check_answers_card_title set to 'All buyers'" do - expect(question.check_answers_card_title).to eq("All buyers") - end - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/savings_spec.rb b/spec/models/form/sales/questions/savings_spec.rb index e16e80799..fd62ab24f 100644 --- a/spec/models/form/sales/questions/savings_spec.rb +++ b/spec/models/form/sales/questions/savings_spec.rb @@ -32,26 +32,6 @@ RSpec.describe Form::Sales::Questions::Savings, type: :model do expect(question.derived?(nil)).to be false end - context "when in 2025", { year: 25 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(false) - end - - it "does not have a check_answers_card_title" do - expect(question.check_answers_card_title).to be_nil - end - end - - context "when in 2026", { year: 26 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(true) - end - - it "has check_answers_card_title set to 'All buyers'" do - expect(question.check_answers_card_title).to eq("All buyers") - end - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/savings_value_check_spec.rb b/spec/models/form/sales/questions/savings_value_check_spec.rb index 0f8649176..14ca49bd1 100644 --- a/spec/models/form/sales/questions/savings_value_check_spec.rb +++ b/spec/models/form/sales/questions/savings_value_check_spec.rb @@ -39,10 +39,6 @@ RSpec.describe Form::Sales::Questions::SavingsValueCheck, type: :model do it "has check_answers_card_number set to 0" do expect(question.check_answers_card_number).to eq(0) end - - it "does not have a check_answers_card_title" do - expect(question.check_answers_card_title).to be_nil - end end context "when in 2026", { year: 26 } do @@ -53,10 +49,6 @@ RSpec.describe Form::Sales::Questions::SavingsValueCheck, type: :model do it "does not have a check_answers_card_number" do expect(question.check_answers_card_number).to be_nil end - - it "has check_answers_card_title set to 'All buyers'" do - expect(question.check_answers_card_title).to eq("All buyers") - end end it "has the correct answer_options" do