From 52f82f4a725abdfc13632af8cc18434dfd2de992 Mon Sep 17 00:00:00 2001 From: Kat Date: Mon, 10 Jan 2022 15:53:55 +0000 Subject: [PATCH] update benefit question options --- app/models/constants/case_log.rb | 8 ++++---- app/models/validations/financial_validations.rb | 2 +- config/forms/2021_2022.json | 12 ++++++------ docs/api/DLUHC-CORE-Data.v1.json | 2 +- spec/factories/case_log.rb | 2 +- spec/features/form/helpers.rb | 2 +- spec/fixtures/complete_case_log.json | 2 +- spec/fixtures/forms/2021_2022.json | 4 ++-- spec/models/case_log_spec.rb | 6 +++--- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/models/constants/case_log.rb b/app/models/constants/case_log.rb index 7e4390d44..94cd874aa 100644 --- a/app/models/constants/case_log.rb +++ b/app/models/constants/case_log.rb @@ -198,10 +198,10 @@ module Constants::CaseLog }.freeze BENEFITS = { - "All" => 1, - "Some" => 2, - "None" => 3, - "Don’t know" => 4, + "1. All" => 1, + "2. Some" => 2, + "3. None" => 3, + "4. Don’t know" => 4, }.freeze PERIOD = { diff --git a/app/models/validations/financial_validations.rb b/app/models/validations/financial_validations.rb index c626ff1f6..48a45e342 100644 --- a/app/models/validations/financial_validations.rb +++ b/app/models/validations/financial_validations.rb @@ -17,7 +17,7 @@ module Validations::FinancialValidations is_employed = EMPLOYED_STATUSES.include?(economic_status) relationship = record["relat#{n}"] is_partner_or_main = relationship == "Partner" || (relationship.nil? && economic_status.present?) - if is_employed && is_partner_or_main && record.benefits == "All" + if is_employed && is_partner_or_main && record.benefits == "1. All" record.errors.add :benefits, "income is from Universal Credit, state pensions or benefits cannot be All if the tenant or the partner works part or full time" end end diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 7ff6ab57c..3df89c20e 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -1937,15 +1937,15 @@ "questions": { "benefits": { "check_answer_label": "Benefits as a proportion of income", - "header": "How much of the tenant’s income is from Universal Credit, state pensions or benefits?", - "hint_text": "", + "header": "How much of the household's income is from Universal Credit, state pensions or benefits?", + "hint_text": "This excludes child and housing benefit, council tax support and tax credits.", "type": "radio", "answer_options": { - "0": "All", - "1": "Some", - "2": "None", + "0": "1. All", + "1": "2. Some", + "2": "3. None", "divider": true, - "3": "Don’t know" + "3": "4. Don’t know" } } } diff --git a/docs/api/DLUHC-CORE-Data.v1.json b/docs/api/DLUHC-CORE-Data.v1.json index 7af091291..0cfd4e837 100644 --- a/docs/api/DLUHC-CORE-Data.v1.json +++ b/docs/api/DLUHC-CORE-Data.v1.json @@ -322,7 +322,7 @@ "wchair": true, "earnings": 1000, "incfreq": "Monthly", - "benefits": "Some", + "benefits": "2. Some", "hb": "6. Universal Credit with housing element (excluding housing benefit)", "period": "Weekly", "brent": 200, diff --git a/spec/factories/case_log.rb b/spec/factories/case_log.rb index c472d6f40..e8c14f102 100644 --- a/spec/factories/case_log.rb +++ b/spec/factories/case_log.rb @@ -71,7 +71,7 @@ FactoryBot.define do offered { 2 } wchair { "Yes" } earnings { 68 } - benefits { "Some" } + benefits { "2. Some" } period { "Fortnightly" } brent { 200 } scharge { 50 } diff --git a/spec/features/form/helpers.rb b/spec/features/form/helpers.rb index 260f4f659..225845101 100644 --- a/spec/features/form/helpers.rb +++ b/spec/features/form/helpers.rb @@ -10,7 +10,7 @@ module Helpers fill_in("case-log-earnings-field", with: 18_000) choose("case-log-incfreq-yearly-field") click_button("Save and continue") - choose("case-log-benefits-all-field") + choose("case-log-benefits-1-all-field") click_button("Save and continue") choose("case-log-hb-10-tenant-prefers-not-to-say-field") click_button("Save and continue") diff --git a/spec/fixtures/complete_case_log.json b/spec/fixtures/complete_case_log.json index 2cd8e44a2..84a5c8725 100644 --- a/spec/fixtures/complete_case_log.json +++ b/spec/fixtures/complete_case_log.json @@ -76,7 +76,7 @@ "wchair": "Yes", "net_income_known": "Yes – the household has a weekly income", "earnings": 150, - "benefits": "Some", + "benefits": "2. Some", "hb": "6. Universal Credit with housing element (excluding housing benefit)", "period": "Fortnightly", "brent": 200, diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index e6c885a8a..af69878fe 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -404,8 +404,8 @@ "header": "How much of the tenant’s income is from Universal Credit, state pensions or benefits?", "type": "radio", "answer_options": { - "0": "All", - "1": "Some" + "0": "1. All", + "1": "2. Some" } } } diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index 1b3b813e4..161b3263e 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -408,7 +408,7 @@ RSpec.describe Form, type: :model do it "Cannot be All if person 1 works full time" do expect { CaseLog.create!( - benefits: "All", + benefits: "1. All", ecstat1: "Full-time - 30 hours or more", owning_organisation: owning_organisation, managing_organisation: managing_organisation, @@ -419,7 +419,7 @@ RSpec.describe Form, type: :model do it "Cannot be All if person 1 works part time" do expect { CaseLog.create!( - benefits: "All", + benefits: "1. All", ecstat1: "Part-time - Less than 30 hours", owning_organisation: owning_organisation, managing_organisation: managing_organisation, @@ -430,7 +430,7 @@ RSpec.describe Form, type: :model do it "Cannot be 1 All if any of persons 2-4 are person 1's partner and work part or full time" do expect { CaseLog.create!( - benefits: "All", + benefits: "1. All", relat2: "Partner", ecstat2: "Part-time - Less than 30 hours", owning_organisation: owning_organisation,