diff --git a/app/models/form/sales/pages/mortgage_length.rb b/app/models/form/sales/pages/mortgage_length.rb index 2877cffd8..46ce4d8e0 100644 --- a/app/models/form/sales/pages/mortgage_length.rb +++ b/app/models/form/sales/pages/mortgage_length.rb @@ -1,4 +1,11 @@ class Form::Sales::Pages::MortgageLength < ::Form::Page + def initialize(id, hsh, subsection) + super + @depends_on = [{ + "mortgageused" => 1, + }] + end + def questions @questions ||= [ Form::Sales::Questions::MortgageLength.new(nil, nil, self), diff --git a/spec/models/form/sales/pages/mortgage_length_spec.rb b/spec/models/form/sales/pages/mortgage_length_spec.rb index bc63bc178..ef2573e57 100644 --- a/spec/models/form/sales/pages/mortgage_length_spec.rb +++ b/spec/models/form/sales/pages/mortgage_length_spec.rb @@ -28,6 +28,8 @@ RSpec.describe Form::Sales::Pages::MortgageLength, type: :model do end it "has correct depends_on" do - expect(page.depends_on).to be_nil + expect(page.depends_on).to eq([{ + "mortgageused" => 1, + }]) end end