Browse Source

update yes option to Yes for has_benefits\

pull/213/head
Kat 4 years ago
parent
commit
31ce30745a
  1. 5
      app/models/case_log.rb
  2. 5
      app/models/constants/case_log.rb
  3. 4
      config/forms/2021_2022.json
  4. 2
      spec/models/case_log_spec.rb

5
app/models/case_log.rb

@ -311,10 +311,7 @@ private
end
def get_has_benefits
return "yes" if ["1. Housing benefit",
"6. Universal Credit with housing element (excluding housing benefit)",
"7. Universal Credit (without housing element)",
"8. Housing benefit and Universal Credit (without housing element)"].include?(hb)
return "Yes" if HAS_BENEFITS_OPTIONS.include?(hb)
end
def all_fields_completed?

5
app/models/constants/case_log.rb

@ -1081,4 +1081,9 @@ module Constants::CaseLog
"Yes – the household has a yearly income" => 2,
"Tenant prefers not to say" => 3,
}.freeze
HAS_BENEFITS_OPTIONS = ["1. Housing benefit",
"6. Universal Credit with housing element (excluding housing benefit)",
"7. Universal Credit (without housing element)",
"8. Housing benefit and Universal Credit (without housing element)"].freeze
end

4
config/forms/2021_2022.json

@ -2611,7 +2611,7 @@
}
}
},
"depends_on": [{ "has_benefits": "yes", "nocharge": "Yes" },{ "has_benefits": "yes", "nocharge": null }]
"depends_on": [{ "has_benefits": "Yes", "nocharge": "Yes" },{ "has_benefits": "yes", "nocharge": null }]
},
"rent_shortfall_amount":{
"header": "",
@ -2626,7 +2626,7 @@
"step": 1
}
},
"depends_on": [{"has_benefits": "yes",
"depends_on": [{"has_benefits": "Yes",
"hbrentshortfall": "Yes"
}]
}

2
spec/models/case_log_spec.rb

@ -1225,7 +1225,7 @@ RSpec.describe Form, type: :model do
case_log.reload
record_from_db = ActiveRecord::Base.connection.execute("select has_benefits from case_logs where id=#{case_log.id}").to_a[0]
expect(record_from_db["has_benefits"]).to eq("yes")
expect(record_from_db["has_benefits"]).to eq("Yes")
end
end
end

Loading…
Cancel
Save