From 03a545b19de139c8a438fdb40955582ecc933999 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Fri, 21 Apr 2023 13:47:19 +0100 Subject: [PATCH] feat: fix tests --- app/models/form/sales/pages/housing_benefits.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/form/sales/pages/housing_benefits.rb b/app/models/form/sales/pages/housing_benefits.rb index 34bc338f9..e2b72790f 100644 --- a/app/models/form/sales/pages/housing_benefits.rb +++ b/app/models/form/sales/pages/housing_benefits.rb @@ -2,14 +2,6 @@ class Form::Sales::Pages::HousingBenefits < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) @joint_purchase = joint_purchase - @depends_on = - [ - if @joint_purchase - { "joint_purchase?" => true } - else - { "not_joint_purchase?" => true } - end, - ] end def questions @@ -17,4 +9,12 @@ class Form::Sales::Pages::HousingBenefits < ::Form::Page Form::Sales::Questions::HousingBenefits.new(nil, nil, self, joint_purchase: @joint_purchase), ] end + + def depends_on + if @joint_purchase + [{ "joint_purchase?" => true }] + else + [{ "not_joint_purchase?" => true }] + end + end end