diff --git a/app/models/form/sales/subsections/household_characteristics.rb b/app/models/form/sales/subsections/household_characteristics.rb index 38a71cf41..6e1b073f8 100644 --- a/app/models/form/sales/subsections/household_characteristics.rb +++ b/app/models/form/sales/subsections/household_characteristics.rb @@ -11,7 +11,9 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::BuyerInterview.new(nil, nil, self), Form::Sales::Pages::PrivacyNotice.new(nil, nil, self), Form::Sales::Pages::Age1.new(nil, nil, self), + Form::Sales::Pages::RetirementValueCheck.new("person_1_age_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::GenderIdentity1.new(nil, nil, self), + Form::Sales::Pages::RetirementValueCheck.new("person_1_gender_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::Buyer1EthnicGroup.new(nil, nil, self), Form::Sales::Pages::Buyer1EthnicBackgroundBlack.new(nil, nil, self), Form::Sales::Pages::Buyer1EthnicBackgroundAsian.new(nil, nil, self), @@ -20,12 +22,16 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::Buyer1EthnicBackgroundWhite.new(nil, nil, self), Form::Sales::Pages::Nationality1.new(nil, nil, self), Form::Sales::Pages::Buyer1WorkingSituation.new(nil, nil, self), + Form::Sales::Pages::RetirementValueCheck.new("person_1_working_situation_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::Buyer1IncomeValueCheck.new("working_situation_buyer_1_income_value_check", nil, self), Form::Sales::Pages::Buyer1LiveInProperty.new(nil, nil, self), Form::Sales::Pages::Buyer2RelationshipToBuyer1.new(nil, nil, self), Form::Sales::Pages::Age2.new(nil, nil, self), + Form::Sales::Pages::RetirementValueCheck.new("person_2_age_retirement_value_check", nil, self, person_index: 2), Form::Sales::Pages::GenderIdentity2.new(nil, nil, self), + Form::Sales::Pages::RetirementValueCheck.new("person_2_gender_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::Buyer2WorkingSituation.new(nil, nil, self), + Form::Sales::Pages::RetirementValueCheck.new("person_2_working_situation_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::Buyer2LiveInProperty.new(nil, nil, self), Form::Sales::Pages::NumberOfOthersInProperty.new(nil, nil, self), Form::Sales::Pages::PersonKnown.new("person_1_known", nil, self, person_index: 2), @@ -34,40 +40,52 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_1_relationship_to_buyer_1_joint_purchase", nil, self, person_index: 3), Form::Sales::Pages::PersonAge.new("person_1_age", nil, self, person_index: 2), Form::Sales::Pages::PersonAge.new("person_1_age_joint_purchase", nil, self, person_index: 3), + Form::Sales::Pages::RetirementValueCheck.new("person_3_age_retirement_value_check", nil, self, person_index: 3), Form::Sales::Pages::PersonGenderIdentity.new("person_1_gender_identity", nil, self, person_index: 2), Form::Sales::Pages::PersonGenderIdentity.new("person_1_gender_identity_joint_purchase", nil, self, person_index: 3), + Form::Sales::Pages::RetirementValueCheck.new("person_3_gender_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::PersonWorkingSituation.new("person_1_working_situation", nil, self, person_index: 2), Form::Sales::Pages::PersonWorkingSituation.new("person_1_working_situation_joint_purchase", nil, self, person_index: 3), + Form::Sales::Pages::RetirementValueCheck.new("person_3_working_situation_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::PersonKnown.new("person_2_known", nil, self, person_index: 3), Form::Sales::Pages::PersonKnown.new("person_2_known_joint_purchase", nil, self, person_index: 4), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_2_relationship_to_buyer_1", nil, self, person_index: 3), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_2_relationship_to_buyer_1_joint_purchase", nil, self, person_index: 4), Form::Sales::Pages::PersonAge.new("person_2_age", nil, self, person_index: 3), Form::Sales::Pages::PersonAge.new("person_2_age_joint_purchase", nil, self, person_index: 4), + Form::Sales::Pages::RetirementValueCheck.new("person_4_age_retirement_value_check", nil, self, person_index: 4), Form::Sales::Pages::PersonGenderIdentity.new("person_2_gender_identity", nil, self, person_index: 3), Form::Sales::Pages::PersonGenderIdentity.new("person_2_gender_identity_joint_purchase", nil, self, person_index: 4), + Form::Sales::Pages::RetirementValueCheck.new("person_4_gender_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::PersonWorkingSituation.new("person_2_working_situation", nil, self, person_index: 3), Form::Sales::Pages::PersonWorkingSituation.new("person_2_working_situation_joint_purchase", nil, self, person_index: 4), + Form::Sales::Pages::RetirementValueCheck.new("person_4_working_situation_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::PersonKnown.new("person_3_known", nil, self, person_index: 4), Form::Sales::Pages::PersonKnown.new("person_3_known_joint_purchase", nil, self, person_index: 5), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_3_relationship_to_buyer_1", nil, self, person_index: 4), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_3_relationship_to_buyer_1_joint_purchase", nil, self, person_index: 5), Form::Sales::Pages::PersonAge.new("person_3_age", nil, self, person_index: 4), Form::Sales::Pages::PersonAge.new("person_3_age_joint_purchase", nil, self, person_index: 5), + Form::Sales::Pages::RetirementValueCheck.new("person_5_age_retirement_value_check", nil, self, person_index: 5), Form::Sales::Pages::PersonGenderIdentity.new("person_3_gender_identity", nil, self, person_index: 4), Form::Sales::Pages::PersonGenderIdentity.new("person_3_gender_identity_joint_purchase", nil, self, person_index: 5), + Form::Sales::Pages::RetirementValueCheck.new("person_5_gender_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::PersonWorkingSituation.new("person_3_working_situation", nil, self, person_index: 4), Form::Sales::Pages::PersonWorkingSituation.new("person_3_working_situation_joint_purchase", nil, self, person_index: 5), + Form::Sales::Pages::RetirementValueCheck.new("person_5_working_situation_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::PersonKnown.new("person_4_known", nil, self, person_index: 5), Form::Sales::Pages::PersonKnown.new("person_4_known_joint_purchase", nil, self, person_index: 6), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_4_relationship_to_buyer_1", nil, self, person_index: 5), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_4_relationship_to_buyer_1_joint_purchase", nil, self, person_index: 6), Form::Sales::Pages::PersonAge.new("person_4_age", nil, self, person_index: 5), Form::Sales::Pages::PersonAge.new("person_4_age_joint_purchase", nil, self, person_index: 6), + Form::Sales::Pages::RetirementValueCheck.new("person_6_age_retirement_value_check", nil, self, person_index: 6), Form::Sales::Pages::PersonGenderIdentity.new("person_4_gender_identity", nil, self, person_index: 5), Form::Sales::Pages::PersonGenderIdentity.new("person_4_gender_identity_joint_purchase", nil, self, person_index: 6), + Form::Sales::Pages::RetirementValueCheck.new("person_6_gender_retirement_value_check", nil, self, person_index: 1), Form::Sales::Pages::PersonWorkingSituation.new("person_4_working_situation", nil, self, person_index: 5), Form::Sales::Pages::PersonWorkingSituation.new("person_4_working_situation_joint_purchase", nil, self, person_index: 6), + Form::Sales::Pages::RetirementValueCheck.new("person_6_working_situation_retirement_value_check", nil, self, person_index: 1), ] end end diff --git a/spec/models/form/sales/subsections/household_characteristics_spec.rb b/spec/models/form/sales/subsections/household_characteristics_spec.rb index 15c8be02f..30d197593 100644 --- a/spec/models/form/sales/subsections/household_characteristics_spec.rb +++ b/spec/models/form/sales/subsections/household_characteristics_spec.rb @@ -17,7 +17,9 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model buyer_interview privacy_notice buyer_1_age + person_1_age_retirement_value_check buyer_1_gender_identity + person_1_gender_retirement_value_check buyer_1_ethnic_group buyer_1_ethnic_background_black buyer_1_ethnic_background_asian @@ -26,12 +28,16 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model buyer_1_ethnic_background_white buyer_1_nationality buyer_1_working_situation + person_1_working_situation_retirement_value_check working_situation_buyer_1_income_value_check buyer_1_live_in_property buyer_2_relationship_to_buyer_1 buyer_2_age + person_2_age_retirement_value_check buyer_2_gender_identity + person_2_gender_retirement_value_check buyer_2_working_situation + person_2_working_situation_retirement_value_check buyer_2_live_in_property number_of_others_in_property person_1_known @@ -40,40 +46,52 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model person_1_relationship_to_buyer_1_joint_purchase person_1_age person_1_age_joint_purchase + person_3_age_retirement_value_check person_1_gender_identity person_1_gender_identity_joint_purchase + person_3_gender_retirement_value_check person_1_working_situation person_1_working_situation_joint_purchase + person_3_working_situation_retirement_value_check person_2_known person_2_known_joint_purchase person_2_relationship_to_buyer_1 person_2_relationship_to_buyer_1_joint_purchase person_2_age person_2_age_joint_purchase + person_4_age_retirement_value_check person_2_gender_identity person_2_gender_identity_joint_purchase + person_4_gender_retirement_value_check person_2_working_situation person_2_working_situation_joint_purchase + person_4_working_situation_retirement_value_check person_3_known person_3_known_joint_purchase person_3_relationship_to_buyer_1 person_3_relationship_to_buyer_1_joint_purchase person_3_age person_3_age_joint_purchase + person_5_age_retirement_value_check person_3_gender_identity person_3_gender_identity_joint_purchase + person_5_gender_retirement_value_check person_3_working_situation person_3_working_situation_joint_purchase + person_5_working_situation_retirement_value_check person_4_known person_4_known_joint_purchase person_4_relationship_to_buyer_1 person_4_relationship_to_buyer_1_joint_purchase person_4_age person_4_age_joint_purchase + person_6_age_retirement_value_check person_4_gender_identity person_4_gender_identity_joint_purchase + person_6_gender_retirement_value_check person_4_working_situation person_4_working_situation_joint_purchase + person_6_working_situation_retirement_value_check ], ) end diff --git a/spec/models/form_handler_spec.rb b/spec/models/form_handler_spec.rb index 1e0483fbc..3bdb56c30 100644 --- a/spec/models/form_handler_spec.rb +++ b/spec/models/form_handler_spec.rb @@ -52,14 +52,14 @@ RSpec.describe FormHandler do it "is able to load a current sales form" do form = form_handler.get_form("current_sales") expect(form).to be_a(Form) - expect(form.pages.count).to eq(149) + expect(form.pages.count).to eq(167) expect(form.name).to eq("2022_2023_sales") end it "is able to load a previous sales form" do form = form_handler.get_form("previous_sales") expect(form).to be_a(Form) - expect(form.pages.count).to eq(149) + expect(form.pages.count).to eq(167) expect(form.name).to eq("2021_2022_sales") end end