diff --git a/app/models/form/sales/pages/about_price_shared_ownership_value_check.rb b/app/models/form/sales/pages/about_price_value_check.rb similarity index 84% rename from app/models/form/sales/pages/about_price_shared_ownership_value_check.rb rename to app/models/form/sales/pages/about_price_value_check.rb index 5b668006a..94df02243 100644 --- a/app/models/form/sales/pages/about_price_shared_ownership_value_check.rb +++ b/app/models/form/sales/pages/about_price_value_check.rb @@ -1,4 +1,4 @@ -class Form::Sales::Pages::AboutPriceSharedOwnershipValueCheck < ::Form::Page +class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @depends_on = [ @@ -34,7 +34,7 @@ class Form::Sales::Pages::AboutPriceSharedOwnershipValueCheck < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::AboutPriceSharedOwnershipValueCheck.new(nil, nil, self), + Form::Sales::Questions::AboutPriceValueCheck.new(nil, nil, self), ] end end diff --git a/app/models/form/sales/questions/about_price_shared_ownership_value_check.rb b/app/models/form/sales/questions/about_price_value_check.rb similarity index 85% rename from app/models/form/sales/questions/about_price_shared_ownership_value_check.rb rename to app/models/form/sales/questions/about_price_value_check.rb index 6758b68a3..2b51cd7fb 100644 --- a/app/models/form/sales/questions/about_price_shared_ownership_value_check.rb +++ b/app/models/form/sales/questions/about_price_value_check.rb @@ -1,4 +1,4 @@ -class Form::Sales::Questions::AboutPriceSharedOwnershipValueCheck < ::Form::Question +class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "value_value_check" diff --git a/app/models/form/sales/subsections/discounted_ownership_scheme.rb b/app/models/form/sales/subsections/discounted_ownership_scheme.rb index 74e408cfd..a44f10ee9 100644 --- a/app/models/form/sales/subsections/discounted_ownership_scheme.rb +++ b/app/models/form/sales/subsections/discounted_ownership_scheme.rb @@ -14,6 +14,7 @@ class Form::Sales::Subsections::DiscountedOwnershipScheme < ::Form::Subsection Form::Sales::Pages::AboutPriceNotRtb.new(nil, nil, self), Form::Sales::Pages::GrantValueCheck.new(nil, nil, self), Form::Sales::Pages::PurchasePriceOutrightOwnership.new("purchase_price_outright_ownership", nil, self), + Form::Sales::Pages::AboutPriceValueCheck.new("about_price_discounted_ownership_value_check", nil, self), Form::Sales::Pages::DepositAndMortgageValueCheck.new("discounted_ownership_deposit_and_mortgage_value_check_after_value_and_discount", nil, self), Form::Sales::Pages::Mortgageused.new("mortgage_used_discounted_ownership", nil, self), Form::Sales::Pages::MortgageValueCheck.new("discounted_ownership_mortgage_used_mortgage_value_check", nil, self), diff --git a/app/models/form/sales/subsections/outright_sale.rb b/app/models/form/sales/subsections/outright_sale.rb index 69f77c4b2..256c1c8dc 100644 --- a/app/models/form/sales/subsections/outright_sale.rb +++ b/app/models/form/sales/subsections/outright_sale.rb @@ -9,6 +9,7 @@ class Form::Sales::Subsections::OutrightSale < ::Form::Subsection def pages @pages ||= [ Form::Sales::Pages::PurchasePriceOutrightOwnership.new("purchase_price_outright_sale", nil, self), + Form::Sales::Pages::AboutPriceValueCheck.new("about_price_outright_sale_value_check", nil, self), Form::Sales::Pages::Mortgageused.new("mortgage_used_outright_sale", nil, self), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_used_mortgage_value_check", nil, self), Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self), diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb index eb057c48c..a43607d7c 100644 --- a/app/models/form/sales/subsections/property_information.rb +++ b/app/models/form/sales/subsections/property_information.rb @@ -9,13 +9,13 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection def pages @pages ||= [ Form::Sales::Pages::PropertyNumberOfBedrooms.new(nil, nil, self), - Form::Sales::Pages::AboutPriceSharedOwnershipValueCheck.new("about_price_shared_ownership_bedrooms_value_check", nil, self), + Form::Sales::Pages::AboutPriceValueCheck.new("about_price_bedrooms_value_check", nil, self), Form::Sales::Pages::PropertyUnitType.new(nil, nil, self), Form::Sales::Pages::MonthlyChargesValueCheck.new("monthly_charges_property_type_value_check", nil, self), Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self), Form::Sales::Pages::Postcode.new(nil, nil, self), Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self), - Form::Sales::Pages::AboutPriceSharedOwnershipValueCheck.new("about_price_shared_ownership_la_value_check", nil, self), + Form::Sales::Pages::AboutPriceValueCheck.new("about_price_la_value_check", nil, self), Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self), ] end diff --git a/app/models/form/sales/subsections/shared_ownership_scheme.rb b/app/models/form/sales/subsections/shared_ownership_scheme.rb index 3012d2a69..1f0cd6450 100644 --- a/app/models/form/sales/subsections/shared_ownership_scheme.rb +++ b/app/models/form/sales/subsections/shared_ownership_scheme.rb @@ -22,7 +22,7 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection Form::Sales::Pages::PreviousPropertyType.new(nil, nil, self), Form::Sales::Pages::PreviousTenure.new(nil, nil, self), Form::Sales::Pages::AboutPriceSharedOwnership.new(nil, nil, self), - Form::Sales::Pages::AboutPriceSharedOwnershipValueCheck.new("about_price_shared_ownership_value_check", nil, self), + Form::Sales::Pages::AboutPriceValueCheck.new("about_price_shared_ownership_value_check", nil, self), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_equity_value_check", nil, self), Form::Sales::Pages::Mortgageused.new("mortgage_used_shared_ownership", nil, self), Form::Sales::Pages::MortgageValueCheck.new("mortgage_used_mortgage_value_check", nil, self), diff --git a/spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb b/spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb index 12cf9b38a..5d1d30037 100644 --- a/spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb +++ b/spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb @@ -20,6 +20,7 @@ RSpec.describe Form::Sales::Subsections::DiscountedOwnershipScheme, type: :model about_price_not_rtb grant_value_check purchase_price_outright_ownership + about_price_discounted_ownership_value_check discounted_ownership_deposit_and_mortgage_value_check_after_value_and_discount mortgage_used_discounted_ownership discounted_ownership_mortgage_used_mortgage_value_check diff --git a/spec/models/form/sales/subsections/outright_sale_spec.rb b/spec/models/form/sales/subsections/outright_sale_spec.rb index 47c062478..b7b0dc846 100644 --- a/spec/models/form/sales/subsections/outright_sale_spec.rb +++ b/spec/models/form/sales/subsections/outright_sale_spec.rb @@ -15,6 +15,7 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do expect(outright_sale.pages.map(&:id)).to eq( %w[ purchase_price_outright_sale + about_price_outright_sale_value_check mortgage_used_outright_sale outright_sale_mortgage_used_mortgage_value_check mortgage_amount_outright_sale diff --git a/spec/models/form/sales/subsections/property_information_spec.rb b/spec/models/form/sales/subsections/property_information_spec.rb index c9ab36136..e65e8dd36 100644 --- a/spec/models/form/sales/subsections/property_information_spec.rb +++ b/spec/models/form/sales/subsections/property_information_spec.rb @@ -15,13 +15,13 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do expect(property_information.pages.map(&:id)).to eq( %w[ property_number_of_bedrooms - about_price_shared_ownership_bedrooms_value_check + about_price_bedrooms_value_check property_unit_type monthly_charges_property_type_value_check property_building_type property_postcode property_local_authority - about_price_shared_ownership_la_value_check + about_price_la_value_check property_wheelchair_accessible ], ) diff --git a/spec/models/form_handler_spec.rb b/spec/models/form_handler_spec.rb index 17ebd4db0..fb7bad4b2 100644 --- a/spec/models/form_handler_spec.rb +++ b/spec/models/form_handler_spec.rb @@ -54,14 +54,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(180) + expect(form.pages.count).to eq(182) 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(180) + expect(form.pages.count).to eq(182) expect(form.name).to eq("2021_2022_sales") end end