Browse Source

Merge branch 'CLDC-1776-sales-information-sections' into CLDC-1521-living-before-purchase

pull/1129/head
natdeanlewissoftwire 3 years ago committed by GitHub
parent
commit
47e71b9b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/models/form/sales/questions/discount.rb
  2. 4
      app/models/form/sales/subsections/discounted_ownership_scheme.rb
  3. 2
      app/models/form_handler.rb
  4. 4
      spec/models/form/sales/questions/discount_spec.rb
  5. 4
      spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb

4
app/models/form/sales/questions/discount.rb

@ -10,8 +10,8 @@ class Form::Sales::Questions::Discount < ::Form::Question
@max = 100
@width = 5
@suffix = "%"
@hint_text = "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)
If discount capped, enter capped %
@hint_text = "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)</br></br>
If discount capped, enter capped %</br></br>
If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given."
end
end

4
app/models/form/sales/subsections/discounted_ownership_scheme.rb

@ -10,9 +10,9 @@ class Form::Sales::Subsections::DiscountedOwnershipScheme < ::Form::Subsection
def pages
@pages ||= [
Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_discounted_ownership", nil, self),
Form::Sales::Pages::AboutPriceRtb.new(nil, nil, self),
Form::Sales::Pages::AboutPriceNotRtb.new(nil, nil, self),
Form::Sales::Pages::AboutDeposit.new("about_deposit_discounted_ownership", nil, self),
Form::Sales::Pages::AboutPriceRtb.new("about_deposit_discounted_ownership", nil, self),
Form::Sales::Pages::AboutPriceNotRtb.new("about_deposit_discounted_ownership", nil, self),
]
end

2
app/models/form_handler.rb

@ -22,8 +22,8 @@ class FormHandler
sales_sections = [
Form::Sales::Sections::PropertyInformation,
Form::Sales::Sections::Household,
Form::Sales::Sections::SaleInformation,
Form::Sales::Sections::Finances,
Form::Sales::Sections::SaleInformation,
]
current_form = Form.new(nil, current_collection_start_year, sales_sections, "sales")
previous_form = Form.new(nil, current_collection_start_year - 1, sales_sections, "sales")

4
spec/models/form/sales/questions/discount_spec.rb

@ -32,8 +32,8 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do
end
it "has the correct hint" do
expect(question.hint_text).to eq("For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)
If discount capped, enter capped %
expect(question.hint_text).to eq("For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)</br></br>
If discount capped, enter capped %</br></br>
If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given.")
end

4
spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb

@ -14,9 +14,9 @@ RSpec.describe Form::Sales::Subsections::DiscountedOwnershipScheme, type: :model
it "has correct pages" do
expect(discounted_ownership_scheme.pages.map(&:id)).to eq(
%w[living_before_purchase_discounted_ownership
about_deposit_discounted_ownership
about_price_rtb
about_price_not_rtb],
about_price_not_rtb
about_deposit_discounted_ownership],
)
end

Loading…
Cancel
Save