Browse Source

Merge pull request #55 from communitiesuk/CLDC-474-receive-income-frequency-validation

CLDC-474 receive income frequency validation
pull/49/head
Dushan 3 years ago committed by GitHub
parent
commit
2721c63264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/models/case_log.rb
  2. 4
      spec/fixtures/complete_case_log.json

4
app/models/case_log.rb

@ -121,6 +121,10 @@ private
dynamically_not_required << "other_reason_for_leaving_last_settled_home"
end
if net_income.to_i.zero?
dynamically_not_required << "net_income_frequency"
end
required.delete_if { |key, _value| dynamically_not_required.include?(key) }
end
end

4
spec/fixtures/complete_case_log.json vendored

@ -68,8 +68,8 @@
"property_major_repairs_date": "05/05/2020",
"property_number_of_times_relet": 2,
"property_wheelchair_accessible": true,
"net_income": 1000,
"net_income_frequency": "Monthly",
"net_income": 0,
"net_income_frequency": null,
"net_income_uc_proportion": "Some",
"housing_benefit": "Universal Credit with housing element, but not Housing Benefit",
"rent_frequency": "Weekly",

Loading…
Cancel
Save