diff --git a/app/models/form/sales/pages/buyer_live_in_value_check.rb b/app/models/form/sales/pages/buyer_live_in_value_check.rb index 99080ae77..bb08ba7f4 100644 --- a/app/models/form/sales/pages/buyer_live_in_value_check.rb +++ b/app/models/form/sales/pages/buyer_live_in_value_check.rb @@ -6,12 +6,13 @@ class Form::Sales::Pages::BuyerLiveInValueCheck < Form::Sales::Pages::Person "buyer#{person_index}_livein_wrong_for_ownership_type?" => true, }, ] + @copy_key = "sales.soft_validations.buyer_livein_value_check.buyer#{person_index}" @title_text = { - "translation" => "soft_validations.buyer#{person_index}_livein_wrong_for_ownership_type.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], } @informative_text = { - "translation" => "soft_validations.buyer#{person_index}_livein_wrong_for_ownership_type.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], } end diff --git a/app/models/form/sales/pages/multiple_partners_value_check.rb b/app/models/form/sales/pages/multiple_partners_value_check.rb index db409f148..048964bcc 100644 --- a/app/models/form/sales/pages/multiple_partners_value_check.rb +++ b/app/models/form/sales/pages/multiple_partners_value_check.rb @@ -6,9 +6,10 @@ class Form::Sales::Pages::MultiplePartnersValueCheck < Form::Sales::Pages::Perso "multiple_partners?" => true, }, ] + @copy_key = "sales.soft_validations.multiple_partners_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.multiple_partners_sales.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [], } @informative_text = {} diff --git a/app/models/form/sales/pages/not_retired_value_check.rb b/app/models/form/sales/pages/not_retired_value_check.rb index 193aa6e7d..1240dcd0a 100644 --- a/app/models/form/sales/pages/not_retired_value_check.rb +++ b/app/models/form/sales/pages/not_retired_value_check.rb @@ -7,11 +7,12 @@ class Form::Sales::Pages::NotRetiredValueCheck < Form::Sales::Pages::Person }, ] @person_index = person_index + @copy_key = "sales.soft_validations.retirement_value_check.max" @title_text = { - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", } end diff --git a/app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb b/app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb index 0254804f0..7ac7b7cad 100644 --- a/app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb +++ b/app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb @@ -1,12 +1,13 @@ class Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) + @copy_key = "sales.soft_validations.old_persons_shared_ownership_value_check" @title_text = { - "translation" => "soft_validations.old_persons_shared_ownership.title_text.#{joint_purchase ? 'two' : 'one'}", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}", "arguments" => [], } @informative_text = { - "translation" => "soft_validations.old_persons_shared_ownership.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } @joint_purchase = joint_purchase diff --git a/app/models/form/sales/pages/partner_under_16_value_check.rb b/app/models/form/sales/pages/partner_under_16_value_check.rb index 5113e1677..6feb8e990 100644 --- a/app/models/form/sales/pages/partner_under_16_value_check.rb +++ b/app/models/form/sales/pages/partner_under_16_value_check.rb @@ -6,9 +6,10 @@ class Form::Sales::Pages::PartnerUnder16ValueCheck < Form::Sales::Pages::Person "person_#{person_index}_partner_under_16?" => true, }, ] + @copy_key = "sales.soft_validations.partner_under_16_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", diff --git a/app/models/form/sales/pages/person_student_not_child_value_check.rb b/app/models/form/sales/pages/person_student_not_child_value_check.rb index a798c8e16..5b88d738b 100644 --- a/app/models/form/sales/pages/person_student_not_child_value_check.rb +++ b/app/models/form/sales/pages/person_student_not_child_value_check.rb @@ -6,9 +6,10 @@ class Form::Sales::Pages::PersonStudentNotChildValueCheck < Form::Sales::Pages:: "person_#{person_index}_student_not_child?" => true, }, ] + @copy_key = "sales.soft_validations.student_not_child_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.student_not_child.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = {} end diff --git a/app/models/form/sales/pages/retirement_value_check.rb b/app/models/form/sales/pages/retirement_value_check.rb index 9e5dbb87f..819e486ca 100644 --- a/app/models/form/sales/pages/retirement_value_check.rb +++ b/app/models/form/sales/pages/retirement_value_check.rb @@ -7,8 +7,9 @@ class Form::Sales::Pages::RetirementValueCheck < Form::Sales::Pages::Person }, ] @person_index = person_index + @copy_key = "sales.soft_validations.retirement_value_check.min" @title_text = { - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", diff --git a/app/models/form/sales/questions/buyer_live_in_value_check.rb b/app/models/form/sales/questions/buyer_live_in_value_check.rb index a4209c38c..1526e1e6e 100644 --- a/app/models/form/sales/questions/buyer_live_in_value_check.rb +++ b/app/models/form/sales/questions/buyer_live_in_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::BuyerLiveInValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "buyer_livein_value_check" - @check_answer_label = "Buyer live in confirmation" + @copy_key = "sales.soft_validations.buyer_livein_value_check.buyer#{person_index}" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::BuyerLiveInValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/sales/questions/multiple_partners_value_check.rb b/app/models/form/sales/questions/multiple_partners_value_check.rb index ce99438d0..06e3af3b3 100644 --- a/app/models/form/sales/questions/multiple_partners_value_check.rb +++ b/app/models/form/sales/questions/multiple_partners_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "multiple_partners_value_check" - @check_answer_label = "Multiple partners confirmation" + @copy_key = "sales.soft_validations.multiple_partners_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/sales/questions/not_retired_value_check.rb b/app/models/form/sales/questions/not_retired_value_check.rb index 58c95c1bb..86b85f294 100644 --- a/app/models/form/sales/questions/not_retired_value_check.rb +++ b/app/models/form/sales/questions/not_retired_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::NotRetiredValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" + @copy_key = "sales.soft_validations.retirement_value_check.max" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::NotRetiredValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this person isn't retired?" end end diff --git a/app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb b/app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb index c869dd3be..601e02ac2 100644 --- a/app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb +++ b/app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::OldPersonsSharedOwnershipValueCheck < ::Form::Ques def initialize(id, hsh, page) super @id = "old_persons_shared_ownership_value_check" - @check_answer_label = "Shared ownership confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.old_persons_shared_ownership_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/partner_under_16_value_check.rb b/app/models/form/sales/questions/partner_under_16_value_check.rb index 4c147b7e5..cca2386fd 100644 --- a/app/models/form/sales/questions/partner_under_16_value_check.rb +++ b/app/models/form/sales/questions/partner_under_16_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PartnerUnder16ValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "partner_under_16_value_check" - @check_answer_label = "Partner under 16 confirmation" + @copy_key = "sales.soft_validations.partner_under_16_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::PartnerUnder16ValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/sales/questions/person_student_not_child_value_check.rb b/app/models/form/sales/questions/person_student_not_child_value_check.rb index fba35d05b..c2ff55688 100644 --- a/app/models/form/sales/questions/person_student_not_child_value_check.rb +++ b/app/models/form/sales/questions/person_student_not_child_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PersonStudentNotChildValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "student_not_child_value_check" - @check_answer_label = "Student not a child confirmation" + @copy_key = "sales.soft_validations.student_not_child_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::PersonStudentNotChildValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this person is not a child?" end end diff --git a/app/models/form/sales/questions/retirement_value_check.rb b/app/models/form/sales/questions/retirement_value_check.rb index 56573490e..6b8b10898 100644 --- a/app/models/form/sales/questions/retirement_value_check.rb +++ b/app/models/form/sales/questions/retirement_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::RetirementValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" + @copy_key = "sales.soft_validations.retirement_value_check.min" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::RetirementValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this person is retired?" end end diff --git a/config/locales/en.yml b/config/locales/en.yml index afa157034..5412c8b2b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -724,30 +724,17 @@ Make sure these answers are correct." hint_text: "This is higher than we would expect." shared_ownership_deposit: title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}." - old_persons_shared_ownership: - title_text: - one: "You told us the buyer is using the Older Persons Shared Ownership scheme." - two: "You told us the buyers are using the Older Persons Shared Ownership scheme." - hint_text: "At least one buyer must be aged 65 years and over to use this scheme." staircase_bought_seems_high: title_text: "You told us that %{percentage}% was bought in this staircasing transaction." hint_text: "Most staircasing transactions are less than 50%" monthly_charges_over_soft_max: title_text: "You told us that the monthly charges were %{mscharge}." hint_text: "This is higher than we would expect." - student_not_child: - title_text: "You told us this person is a student aged between 16 and 19." discounted_sale_value: title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}." informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}." care_home_charges: title_text: "Care home charges should be provided if this is a care home accommodation." - buyer1_livein_wrong_for_ownership_type: - title_text: "You told us that buyer 1 will not live in the property." - hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property." - buyer2_livein_wrong_for_ownership_type: - title_text: "You told us that buyer 2 will not live in the property." - hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property." percentage_discount_value: title_text: "You told us that the percentage discount is %{discount}." hint_text: "This is higher than we would expect." @@ -783,12 +770,8 @@ Make sure these answers are correct." informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually." partner_under_16_lettings: title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." - partner_under_16_sales: - title: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1." multiple_partners_lettings: title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." - multiple_partners_sales: - title: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1." devise: two_factor_authentication: diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml index a0912555a..2e6a1f864 100644 --- a/config/locales/forms/2023/sales/soft_validations.en.yml +++ b/config/locales/forms/2023/sales/soft_validations.en.yml @@ -3,25 +3,51 @@ en: 2023: sales: soft_validations: - income1_value_check: + retirement_value_check: + max: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn't retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "The minimum expected retirement age in England is 66." + min: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person is retired?" + title_text: "You told us this person is aged %{age} years and retired." + informative_text: "The minimum expected retirement age in England is 66." + old_persons_shared_ownership_value_check: page_header: "" + check_answer_label: "Shared ownership confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: + joint_purchase: "You told us the buyers are using the Older Persons Shared Ownership scheme." + not_joint_purchase: "You told us the buyer is using the Older Persons Shared Ownership scheme." + informative_text: "At least one buyer must be aged 65 years and over to use this scheme." + income1_value_check: check_answer_label: "Buyer 1 income confirmation" hint_text: "" question_text: "Are you sure this is correct?" min: + page_header: "" title_text: "You told us income was %{income}." informative_text: "This is less than we would expect for someone in this working situation." max: + page_header: "" title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?" income2_value_check: - page_header: "" check_answer_label: "Buyer 2 income confirmation" hint_text: "" question_text: "Are you sure this is correct?" min: + page_header: "" title_text: "You told us income was %{income}." informative_text: "This is less than we would expect for someone in this working situation." max: + page_header: "" title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?" combined_income_value_check: page_header: "" @@ -64,3 +90,36 @@ en: hint_text: "" question_text: "You told us that someone in the household uses a wheelchair." title_text: "You told us that someone in the household uses a wheelchair." + buyer_livein_value_check: + buyer1: + page_header: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that buyer 1 will not live in the property." + informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property." + buyer2: + page_header: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that buyer 2 will not live in the property." + informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property." + student_not_child_value_check: + page_header: "" + check_answer_label: "Student not a child confirmation" + hint_text: "" + question_text: "Are you sure this person is not a child?" + title_text: "You told us this person is a student aged between 16 and 19." + partner_under_16_value_check: + page_header: "" + check_answer_label: "Partner under 16 confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1." + multiple_partners_value_check: + page_header: "" + check_answer_label: "Multiple partners confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1." diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml index 2c7ac6e3e..c42803c15 100644 --- a/config/locales/forms/2024/sales/soft_validations.en.yml +++ b/config/locales/forms/2024/sales/soft_validations.en.yml @@ -3,25 +3,51 @@ en: 2024: sales: soft_validations: - income1_value_check: + retirement_value_check: + max: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn't retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "The minimum expected retirement age in England is 66." + min: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person is retired?" + title_text: "You told us this person is aged %{age} years and retired." + informative_text: "The minimum expected retirement age in England is 66." + old_persons_shared_ownership_value_check: page_header: "" + check_answer_label: "Shared ownership confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: + joint_purchase: "You told us the buyers are using the Older Persons Shared Ownership scheme." + not_joint_purchase: "You told us the buyer is using the Older Persons Shared Ownership scheme." + informative_text: "At least one buyer must be aged 65 years and over to use this scheme." + income1_value_check: check_answer_label: "Buyer 1 income confirmation" hint_text: "" question_text: "Are you sure this is correct?" min: + page_header: "" title_text: "You told us income was %{income}." informative_text: "This is less than we would expect for someone in this working situation." max: + page_header: "" title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?" income2_value_check: - page_header: "" check_answer_label: "Buyer 2 income confirmation" hint_text: "" question_text: "Are you sure this is correct?" min: + page_header: "" title_text: "You told us income was %{income}." informative_text: "This is less than we would expect for someone in this working situation." max: + page_header: "" title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?" combined_income_value_check: page_header: "" @@ -64,3 +90,36 @@ en: hint_text: "" question_text: "You told us that someone in the household uses a wheelchair." title_text: "You told us that someone in the household uses a wheelchair." + buyer_livein_value_check: + buyer1: + page_header: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that buyer 1 will not live in the property." + informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property." + buyer2: + page_header: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that buyer 2 will not live in the property." + informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property." + student_not_child_value_check: + page_header: "" + check_answer_label: "Student not a child confirmation" + hint_text: "" + question_text: "Are you sure this person is not a child?" + title_text: "You told us this person is a student aged between 16 and 19." + partner_under_16_value_check: + page_header: "" + check_answer_label: "Partner under 16 confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1." + multiple_partners_value_check: + page_header: "" + check_answer_label: "Multiple partners confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1." diff --git a/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb b/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb index 4bce29312..72234b6d5 100644 --- a/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb @@ -6,7 +6,8 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do let(:page_id) { "buyer_1_live_in_value_check" } let(:page_definition) { nil } let(:person_index) { 1 } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -34,7 +35,7 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.buyer1_livein_wrong_for_ownership_type.title_text", + "translation" => "forms.2024.sales.soft_validations.buyer_livein_value_check.buyer1.title_text", "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], }) end @@ -56,7 +57,7 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.buyer2_livein_wrong_for_ownership_type.title_text", + "translation" => "forms.2024.sales.soft_validations.buyer_livein_value_check.buyer2.title_text", "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], }) end diff --git a/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb b/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb index 890a24e6a..b0d6622f1 100644 --- a/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } let(:person_index) { 1 } let(:page_id) { "multiple_partners_value_check" } @@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_sales.title", + "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text", "arguments" => [], }) end @@ -71,7 +72,7 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_sales.title", + "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text", "arguments" => [], }) end diff --git a/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb b/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb index 8bc20cef7..19292db35 100644 --- a/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb +++ b/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m let(:page_id) { "old_persons_shared_ownership_value_check" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -34,13 +35,13 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.old_persons_shared_ownership.title_text.one", + "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.title_text.not_joint_purchase", "arguments" => [], }) end it "has the correct informative_text" do - expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.old_persons_shared_ownership.hint_text" }) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.informative_text" }) end it "has the correct interruption_screen_question_ids" do @@ -52,7 +53,7 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.old_persons_shared_ownership.title_text.two", + "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.title_text.joint_purchase", "arguments" => [], }) end diff --git a/spec/models/form/sales/pages/partner_under16_value_check_spec.rb b/spec/models/form/sales/pages/partner_under16_value_check_spec.rb index fe11bdc86..8c5d73755 100644 --- a/spec/models/form/sales/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/sales/pages/partner_under16_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } let(:person_index) { 1 } let(:page_id) { "partner_under_16_value_check" } @@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age1", @@ -77,7 +78,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age2", @@ -115,7 +116,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age3", @@ -153,7 +154,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age4", @@ -191,7 +192,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age5", @@ -229,7 +230,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age6", diff --git a/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb b/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb index 9185f9f1c..0914a2278 100644 --- a/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb +++ b/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } let(:person_index) { 2 } let(:page_id) { "person_2_student_not_child_value_check" } @@ -23,7 +24,7 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.student_not_child.title_text", + "translation" => "forms.2024.sales.soft_validations.student_not_child_value_check.title_text", }) end diff --git a/spec/models/form/sales/pages/retirement_value_check_spec.rb b/spec/models/form/sales/pages/retirement_value_check_spec.rb index 6df7a379b..ba9405885 100644 --- a/spec/models/form/sales/pages/retirement_value_check_spec.rb +++ b/spec/models/form/sales/pages/retirement_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } let(:person_index) { 1 } let(:page_id) { "person_1_retirement_value_check" } @@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age1", @@ -77,7 +78,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age2", @@ -115,7 +116,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age3", @@ -153,7 +154,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age4", @@ -191,7 +192,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age5", @@ -229,7 +230,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age6",