Browse Source

more routing

pull/1179/head
Kat 3 years ago
parent
commit
3c43f23fd1
  1. 4
      app/models/form/sales/pages/about_deposit_without_discount.rb
  2. 4
      app/models/form/sales/questions/deposit_amount.rb
  3. 4
      spec/models/form/sales/pages/about_deposit_without_discount_spec.rb

4
app/models/form/sales/pages/about_deposit_without_discount.rb

@ -2,7 +2,9 @@ class Form::Sales::Pages::AboutDepositWithoutDiscount < ::Form::Page
def initialize(id, hsh, subsection)
super
@header = "About the deposit"
@depends_on = [{ "is_type_discount?" => false, "mortgageused" => 1 }]
@depends_on = [{ "is_type_discount?" => false, "ownershipsch" => 1 },
{ "ownershipsch" => 2 },
{ "ownershipsch" => 3, "mortgageused" => 1 }]
end
def questions

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

@ -11,4 +11,8 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question
@hint_text = "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage"
@derived = true
end
def selected_answer_option_is_derived?(_log)
true
end
end

4
spec/models/form/sales/pages/about_deposit_without_discount_spec.rb

@ -29,7 +29,9 @@ RSpec.describe Form::Sales::Pages::AboutDepositWithoutDiscount, type: :model do
it "has correct depends_on" do
expect(page.depends_on).to eq(
[{ "is_type_discount?" => false, "mortgageused" => 1 }],
[{ "is_type_discount?" => false, "ownershipsch" => 1 },
{ "ownershipsch" => 2 },
{ "ownershipsch" => 3, "mortgageused" => 1 }],
)
end
end

Loading…
Cancel
Save