Browse Source

Conditionally display mortgage amount (#1158)

pull/1103/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
fa415916ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/models/form/sales/pages/mortgage_amount.rb
  2. 4
      spec/models/form/sales/pages/mortgage_amount_spec.rb

3
app/models/form/sales/pages/mortgage_amount.rb

@ -4,6 +4,9 @@ class Form::Sales::Pages::MortgageAmount < ::Form::Page
@header = "Mortgage Amount" @header = "Mortgage Amount"
@description = "" @description = ""
@subsection = subsection @subsection = subsection
@depends_on = [{
"mortgageused" => 1,
}]
end end
def questions def questions

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

@ -28,6 +28,8 @@ RSpec.describe Form::Sales::Pages::MortgageAmount, type: :model do
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to be_nil expect(page.depends_on).to eq([{
"mortgageused" => 1,
}])
end end
end end

Loading…
Cancel
Save