Browse Source

Merge branch 'main' into CLDC-1917-allow-23-24-form

pull/1318/head
natdeanlewissoftwire 2 years ago
parent
commit
02789668d9
  1. 4
      app/models/form/sales/pages/about_price_value_check.rb
  2. 2
      app/models/form/sales/questions/about_price_value_check.rb
  3. 1
      app/models/form/sales/subsections/discounted_ownership_scheme.rb
  4. 1
      app/models/form/sales/subsections/outright_sale.rb
  5. 4
      app/models/form/sales/subsections/property_information.rb
  6. 2
      app/models/form/sales/subsections/shared_ownership_scheme.rb
  7. 1
      spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb
  8. 1
      spec/models/form/sales/subsections/outright_sale_spec.rb
  9. 4
      spec/models/form/sales/subsections/property_information_spec.rb
  10. 4
      spec/models/form_handler_spec.rb

4
app/models/form/sales/pages/about_price_shared_ownership_value_check.rb → 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

2
app/models/form/sales/questions/about_price_shared_ownership_value_check.rb → 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"

1
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),

1
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),

4
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

2
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),

1
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

1
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

4
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
],
)

4
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

Loading…
Cancel
Save