Browse Source

CLDC-4143: Update non males validation name

reference to 'soft validation' we found confusing
pull/3183/head
samyou-softwire 4 weeks ago
parent
commit
85b3a13d4c
  1. 2
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb
  2. 2
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb
  3. 2
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb
  4. 2
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb
  5. 2
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb
  6. 2
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb
  7. 4
      app/models/validations/soft_validations.rb
  8. 36
      config/forms/2021_2022.json
  9. 36
      config/forms/2022_2023.json
  10. 4
      spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb
  11. 4
      spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb
  12. 28
      spec/models/validations/soft_validations_spec.rb

2
app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb

@ -3,7 +3,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValu
super(id, hsh, subsection)
@id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "non_males_in_pregnant_household_in_soft_validation_range?" => true }]
@depends_on = [{ "non_males_in_pregnant_household_not_in_pregnancy_range?" => true }]
@title_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],

2
app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb

@ -3,7 +3,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembV
super(id, hsh, subsection)
@id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "non_males_in_pregnant_household_in_soft_validation_range?" => true }]
@depends_on = [{ "non_males_in_pregnant_household_not_in_pregnancy_range?" => true }]
@title_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],

2
app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb

@ -3,7 +3,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCh
super
@id = "females_in_soft_age_range_in_pregnant_household_lead_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "non_males_in_pregnant_household_in_soft_validation_range?" => true }]
@depends_on = [{ "non_males_in_pregnant_household_not_in_pregnancy_range?" => true }]
@title_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],

2
app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb

@ -5,7 +5,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [
{
"non_males_in_pregnant_household_in_soft_validation_range?" => true,
"non_males_in_pregnant_household_not_in_pregnancy_range?" => true,
"age#{person_index}_known" => 0,
},
]

2
app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb

@ -6,7 +6,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue
@depends_on = [
{
"non_males_in_pregnant_household_in_soft_validation_range?" => true,
"non_males_in_pregnant_household_not_in_pregnancy_range?" => true,
"details_known_#{person_index}" => 0,
},
]

2
app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb

@ -3,7 +3,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck
super
@id = "females_in_soft_age_range_in_pregnant_household_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "non_males_in_pregnant_household_in_soft_validation_range?" => true }]
@depends_on = [{ "non_males_in_pregnant_household_not_in_pregnancy_range?" => true }]
@title_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],

4
app/models/validations/soft_validations.rb

@ -76,14 +76,14 @@ module Validations::SoftValidations
end
def no_household_member_likely_to_be_pregnant?
all_male_tenants_in_a_pregnant_household? || non_males_in_pregnant_household_in_soft_validation_range?
all_male_tenants_in_a_pregnant_household? || non_males_in_pregnant_household_not_in_pregnancy_range?
end
def all_male_tenants_in_a_pregnant_household?
all_tenants_gender_information_completed? && all_male_tenants_in_the_household? && preg_occ == 1
end
def non_males_in_pregnant_household_in_soft_validation_range?
def non_males_in_pregnant_household_not_in_pregnancy_range?
all_tenants_age_and_gender_information_completed? && non_males_in_the_household? && !any_non_male_in_expected_pregnancy_age_range(16, 50) && preg_occ == 1
end

36
config/forms/2021_2022.json

@ -1213,7 +1213,7 @@
"females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true
"non_males_in_pregnant_household_not_in_pregnancy_range?": true
}
],
"title_text": {
@ -1355,7 +1355,7 @@
"females_in_soft_age_range_in_pregnant_household_lead_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true
"non_males_in_pregnant_household_not_in_pregnancy_range?": true
}
],
"title_text": {
@ -1476,7 +1476,7 @@
"females_in_soft_age_range_in_pregnant_household_lead_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true
"non_males_in_pregnant_household_not_in_pregnancy_range?": true
}
],
"title_text": {
@ -2135,7 +2135,7 @@
"females_in_soft_age_range_in_pregnant_household_person_2_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age2_known": 0
}
],
@ -2258,7 +2258,7 @@
"females_in_soft_age_range_in_pregnant_household_person_2_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_2": 0
}
],
@ -2670,7 +2670,7 @@
"females_in_soft_age_range_in_pregnant_household_person_3_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age3_known": 0
}
],
@ -2793,7 +2793,7 @@
"females_in_soft_age_range_in_pregnant_household_person_3_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_3": 0
}
],
@ -3202,7 +3202,7 @@
"females_in_soft_age_range_in_pregnant_household_person_4_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age4_known": 0
}
],
@ -3325,7 +3325,7 @@
"females_in_soft_age_range_in_pregnant_household_person_4_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_4": 0
}
],
@ -3731,7 +3731,7 @@
"females_in_soft_age_range_in_pregnant_household_person_5_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age5_known": 0
}
],
@ -3854,7 +3854,7 @@
"females_in_soft_age_range_in_pregnant_household_person_5_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_5": 0
}
],
@ -4257,7 +4257,7 @@
"females_in_soft_age_range_in_pregnant_household_person_6_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age6_known": 0
}
],
@ -4380,7 +4380,7 @@
"females_in_soft_age_range_in_pregnant_household_person_6_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_6": 0
}
],
@ -4780,7 +4780,7 @@
"females_in_soft_age_range_in_pregnant_household_person_7_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age7_known": 0
}
],
@ -4903,7 +4903,7 @@
"females_in_soft_age_range_in_pregnant_household_person_7_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_7": 0
}
],
@ -5300,7 +5300,7 @@
"females_in_soft_age_range_in_pregnant_household_person_8_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age8_known": 0
}
],
@ -5423,7 +5423,7 @@
"females_in_soft_age_range_in_pregnant_household_person_8_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_8": 0
}
],
@ -5837,7 +5837,7 @@
"females_in_soft_age_range_in_pregnant_household_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true
"non_males_in_pregnant_household_not_in_pregnancy_range?": true
}
],
"title_text": {

36
config/forms/2022_2023.json

@ -1254,7 +1254,7 @@
"females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true
"non_males_in_pregnant_household_not_in_pregnancy_range?": true
}
],
"title_text": {
@ -1426,7 +1426,7 @@
"females_in_soft_age_range_in_pregnant_household_lead_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true
"non_males_in_pregnant_household_not_in_pregnancy_range?": true
}
],
"title_text": {
@ -1577,7 +1577,7 @@
"females_in_soft_age_range_in_pregnant_household_lead_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true
"non_males_in_pregnant_household_not_in_pregnancy_range?": true
}
],
"title_text": {
@ -2218,7 +2218,7 @@
"females_in_soft_age_range_in_pregnant_household_person_2_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age2_known": 0
}
],
@ -2371,7 +2371,7 @@
"females_in_soft_age_range_in_pregnant_household_person_2_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_2": 0
}
],
@ -2801,7 +2801,7 @@
"females_in_soft_age_range_in_pregnant_household_person_3_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age3_known": 0
}
],
@ -2954,7 +2954,7 @@
"females_in_soft_age_range_in_pregnant_household_person_3_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_3": 0
}
],
@ -3381,7 +3381,7 @@
"females_in_soft_age_range_in_pregnant_household_person_4_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age4_known": 0
}
],
@ -3534,7 +3534,7 @@
"females_in_soft_age_range_in_pregnant_household_person_4_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_4": 0
}
],
@ -3958,7 +3958,7 @@
"females_in_soft_age_range_in_pregnant_household_person_5_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age5_known": 0
}
],
@ -4111,7 +4111,7 @@
"females_in_soft_age_range_in_pregnant_household_person_5_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_5": 0
}
],
@ -4532,7 +4532,7 @@
"females_in_soft_age_range_in_pregnant_household_person_6_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age6_known": 0
}
],
@ -4685,7 +4685,7 @@
"females_in_soft_age_range_in_pregnant_household_person_6_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_6": 0
}
],
@ -5103,7 +5103,7 @@
"females_in_soft_age_range_in_pregnant_household_person_7_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age7_known": 0
}
],
@ -5256,7 +5256,7 @@
"females_in_soft_age_range_in_pregnant_household_person_7_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_7": 0
}
],
@ -5671,7 +5671,7 @@
"females_in_soft_age_range_in_pregnant_household_person_8_age_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"age8_known": 0
}
],
@ -5824,7 +5824,7 @@
"females_in_soft_age_range_in_pregnant_household_person_8_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true,
"non_males_in_pregnant_household_not_in_pregnancy_range?": true,
"details_known_8": 0
}
],
@ -6259,7 +6259,7 @@
"females_in_soft_age_range_in_pregnant_household_value_check": {
"depends_on": [
{
"non_males_in_pregnant_household_in_soft_validation_range?": true
"non_males_in_pregnant_household_not_in_pregnancy_range?": true
}
],
"title_text": {

4
spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb

@ -29,7 +29,7 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe
[
{
"age2_known" => 0,
"non_males_in_pregnant_household_in_soft_validation_range?" => true,
"non_males_in_pregnant_household_not_in_pregnancy_range?" => true,
},
],
)
@ -62,7 +62,7 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe
[
{
"age3_known" => 0,
"non_males_in_pregnant_household_in_soft_validation_range?" => true,
"non_males_in_pregnant_household_not_in_pregnancy_range?" => true,
},
],
)

4
spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb

@ -29,7 +29,7 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe
[
{
"details_known_2" => 0,
"non_males_in_pregnant_household_in_soft_validation_range?" => true,
"non_males_in_pregnant_household_not_in_pregnancy_range?" => true,
},
],
)
@ -62,7 +62,7 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe
[
{
"details_known_3" => 0,
"non_males_in_pregnant_household_in_soft_validation_range?" => true,
"non_males_in_pregnant_household_not_in_pregnancy_range?" => true,
},
],
)

28
spec/models/validations/soft_validations_spec.rb

@ -205,7 +205,7 @@ RSpec.describe Validations::SoftValidations do
record.age1 = 18
record.sex1 = "M"
record.age1_known = 0
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be true
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true
end
end
@ -216,7 +216,7 @@ RSpec.describe Validations::SoftValidations do
record.preg_occ = 1
record.hhmemb = 1
record.age1_known = 0
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be true
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true
end
end
@ -231,7 +231,7 @@ RSpec.describe Validations::SoftValidations do
record.age1 = 18
record.sex1 = "M"
record.age1_known = 0
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be false
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false
end
end
@ -242,7 +242,7 @@ RSpec.describe Validations::SoftValidations do
record.preg_occ = 1
record.hhmemb = 1
record.age1_known = 0
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be false
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false
end
end
@ -253,7 +253,7 @@ RSpec.describe Validations::SoftValidations do
record.preg_occ = 1
record.hhmemb = 1
expect(record.all_male_tenants_in_a_pregnant_household?).to be false
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be false
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false
end
end
@ -262,7 +262,7 @@ RSpec.describe Validations::SoftValidations do
record.preg_occ = 1
record.hhmemb = 2
expect(record.all_male_tenants_in_a_pregnant_household?).to be false
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be false
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false
end
end
@ -276,7 +276,7 @@ RSpec.describe Validations::SoftValidations do
end
record.preg_occ = 1
record.hhmemb = 9
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be false
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false
end
end
end
@ -340,7 +340,7 @@ RSpec.describe Validations::SoftValidations do
end
it "shows the interruption screen" do
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be true
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true
end
end
@ -352,7 +352,7 @@ RSpec.describe Validations::SoftValidations do
end
it "shows the interruption screen" do
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be true
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true
end
end
@ -365,7 +365,7 @@ RSpec.describe Validations::SoftValidations do
end
it "shows the interruption screen" do
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be true
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true
end
end
@ -378,7 +378,7 @@ RSpec.describe Validations::SoftValidations do
end
it "shows the interruption screen" do
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be true
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true
end
end
@ -390,7 +390,7 @@ RSpec.describe Validations::SoftValidations do
end
it "does not show the interruption screen" do
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be false
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false
end
end
@ -405,7 +405,7 @@ RSpec.describe Validations::SoftValidations do
end
it "does not show the interruption screen" do
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be false
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false
end
end
@ -423,7 +423,7 @@ RSpec.describe Validations::SoftValidations do
end
it "does not show the interruption screen" do
expect(record.non_males_in_pregnant_household_in_soft_validation_range?).to be false
expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false
end
end
end

Loading…
Cancel
Save