Browse Source

Bugfixes (#93)

* Update footer email

* Page validations need to match form page names

* Update specs
pull/94/head
Daniel Baark 3 years ago committed by GitHub
parent
commit
b764b42a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/validations/household_validations.rb
  2. 2
      app/views/layouts/_footer.html.erb
  3. 4
      config/forms/2021_2022.json
  4. 2
      spec/controllers/case_logs_controller_spec.rb
  5. 2
      spec/features/case_log_spec.rb

2
app/validations/household_validations.rb

@ -45,7 +45,7 @@ module HouseholdValidations
end end
end end
def validate_household_pregnancy(record) def validate_pregnancy(record)
if (record.preg_occ == "Yes" || record.preg_occ == "Prefer not to say") && !women_of_child_bearing_age_in_household(record) if (record.preg_occ == "Yes" || record.preg_occ == "Prefer not to say") && !women_of_child_bearing_age_in_household(record)
record.errors.add :preg_occ, "You must answer no as there are no female tenants aged 16-50 in the property" record.errors.add :preg_occ, "You must answer no as there are no female tenants aged 16-50 in the property"
end end

2
app/views/layouts/_footer.html.erb

@ -22,7 +22,7 @@
<h3 class="govuk-heading-s govuk-!-margin-bottom-1">Email</h3> <h3 class="govuk-heading-s govuk-!-margin-bottom-1">Email</h3>
<ul class="govuk-list govuk-!-font-size-16"> <ul class="govuk-list govuk-!-font-size-16">
<li> <li>
<a class="govuk-link govuk-footer__link" href="mailto:mhclg.digital-services@communities.gov.uk?subject=CORE">mhclg.digital-services@communities.gov.uk</a> <a class="govuk-link govuk-footer__link" href="mailto:mhclg.digital-services@communities.gov.uk?subject=CORE">dluhc.digital-services@communities.gov.uk</a>
</li> </li>
<li>We aim to respond within 2 working days</li> <li>We aim to respond within 2 working days</li>
</ul> </ul>

4
config/forms/2021_2022.json

@ -209,7 +209,7 @@
} }
} }
}, },
"age1": { "person_1_age": {
"header": "", "header": "",
"description": "", "description": "",
"questions": { "questions": {
@ -307,7 +307,7 @@
} }
} }
}, },
"tenant_economic_status": { "person_1_economic": {
"header": "", "header": "",
"description": "", "description": "",
"questions": { "questions": {

2
spec/controllers/case_logs_controller_spec.rb

@ -125,7 +125,7 @@ RSpec.describe CaseLogsController, type: :controller do
context "conditional routing" do context "conditional routing" do
before do before do
allow_any_instance_of(CaseLogValidator).to receive(:validate_household_pregnancy).and_return(true) allow_any_instance_of(CaseLogValidator).to receive(:validate_pregnancy).and_return(true)
end end
let(:case_log_form_conditional_question_yes_params) do let(:case_log_form_conditional_question_yes_params) do

2
spec/features/case_log_spec.rb

@ -449,7 +449,7 @@ RSpec.describe "Test Features" do
describe "conditional page routing", js: true do describe "conditional page routing", js: true do
before do before do
allow_any_instance_of(CaseLogValidator).to receive(:validate_household_pregnancy).and_return(true) allow_any_instance_of(CaseLogValidator).to receive(:validate_pregnancy).and_return(true)
end end
it "can route the user to a different page based on their answer on the current page" do it "can route the user to a different page based on their answer on the current page" do

Loading…
Cancel
Save