Browse Source

CLDC-4105: Add tests

soft validations

models

add a label file for this year so the export_codes tests have authentic labels to pull

the old BU completed log answers throw the new soft validation. needed to change illness to 3 to avoid the soft validation as it should be a complete log
CLDC-4105-working-situation-illness-soft-validation
Samuel Young 4 days ago
parent
commit
003844e198
  1. 6
      spec/fixtures/files/lettings_log_csv_export_codes_26.csv
  2. 6
      spec/fixtures/files/lettings_log_csv_export_labels_26.csv
  3. 1
      spec/fixtures/variable_definitions/lettings_download_26_27.csv
  4. 4
      spec/lib/tasks/log_variable_definitions_spec.rb
  5. 49
      spec/models/form/lettings/questions/working_situation_illness_check_spec.rb
  6. 56
      spec/models/form/lettings/subsections/household_characteristics_spec.rb
  7. 36
      spec/models/form/lettings/subsections/household_needs_spec.rb
  8. 38
      spec/models/validations/soft_validations_spec.rb
  9. 2
      spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb

6
spec/fixtures/files/lettings_log_csv_export_codes_26.csv vendored

File diff suppressed because one or more lines are too long

6
spec/fixtures/files/lettings_log_csv_export_labels_26.csv vendored

File diff suppressed because one or more lines are too long

1
spec/fixtures/variable_definitions/lettings_download_26_27.csv vendored

@ -0,0 +1 @@
working_situation_illness_check,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.
1 working_situation_illness_check The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.

4
spec/lib/tasks/log_variable_definitions_spec.rb

@ -14,7 +14,7 @@ RSpec.describe "log_variable_definitions" do
end end
it "adds CsvVariableDefinition records from each file in the specified directory" do it "adds CsvVariableDefinition records from each file in the specified directory" do
expect { task.invoke(path) }.to change(CsvVariableDefinition, :count).by(416) expect { task.invoke(path) }.to change(CsvVariableDefinition, :count).by(417)
end end
it "handles an empty directory without errors" do it "handles an empty directory without errors" do
@ -34,7 +34,7 @@ RSpec.describe "log_variable_definitions" do
task.invoke(path) task.invoke(path)
second_run_count = CsvVariableDefinition.count second_run_count = CsvVariableDefinition.count
expect(first_run_count).to eq(initial_count + 416) expect(first_run_count).to eq(initial_count + 417)
expect(second_run_count).to eq(first_run_count) expect(second_run_count).to eq(first_run_count)
end end
end end

49
spec/models/form/lettings/questions/working_situation_illness_check_spec.rb

@ -0,0 +1,49 @@
require "rails_helper"
RSpec.describe Form::Lettings::Questions::WorkingSituationIllnessCheck, type: :model do
subject(:question) { described_class.new(question_id, question_definition, page, person_index: 1) }
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page, copy_key: nil) }
it "has correct page" do
expect(question.page).to eq(page)
end
it "has the correct id" do
expect(question.id).to eq("working_situation_illness_check")
end
it "has the correct type" do
expect(question.type).to eq("interruption_screen")
end
it "is not marked as derived" do
expect(question.derived?(nil)).to be false
end
it "has a correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(1)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
})
end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to eq({
"depends_on" => [
{
"working_situation_illness_check" => 0,
},
{
"working_situation_illness_check" => 1,
},
],
})
end
end

56
spec/models/form/lettings/subsections/household_characteristics_spec.rb

@ -10,22 +10,23 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
before do before do
allow(section).to receive(:form).and_return(form) allow(section).to receive(:form).and_return(form)
allow(form).to receive(:start_year_2024_or_later?).and_return(false)
allow(form).to receive(:start_year_2025_or_later?).and_return(false) allow(form).to receive(:start_year_2025_or_later?).and_return(false)
allow(form).to receive(:start_year_2026_or_later?).and_return(false)
end end
it "has correct section" do it "has correct section" do
expect(household_characteristics.section).to eq(section) expect(household_characteristics.section).to eq(section)
end end
context "with start year before 2024" do context "with start year >= 2024", metadata: { year: 24 } do
before do before do
allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
end end
it "has correct pages" do it "has correct pages" do
expect(household_characteristics.pages.map(&:id)).to eq( expect(household_characteristics.pages.map(&:id)).to eq(
%w[ %w[
declaration
household_members household_members
no_females_pregnant_household_lead_hhmemb_value_check no_females_pregnant_household_lead_hhmemb_value_check
females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check
@ -50,11 +51,14 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_lead_tenant_over_retirement_value_check working_situation_lead_tenant_over_retirement_value_check
person_2_known person_2_known
person_2_relationship_to_lead person_2_relationship_to_lead
relationship_2_partner_under_16_value_check
relationship_2_multiple_partners_value_check
person_2_age person_2_age
no_females_pregnant_household_person_2_age_value_check no_females_pregnant_household_person_2_age_value_check
females_in_soft_age_range_in_pregnant_household_person_2_age_value_check females_in_soft_age_range_in_pregnant_household_person_2_age_value_check
age_2_under_retirement_value_check age_2_under_retirement_value_check
age_2_over_retirement_value_check age_2_over_retirement_value_check
age_2_partner_under_16_value_check
person_2_gender_identity person_2_gender_identity
no_females_pregnant_household_person_2_value_check no_females_pregnant_household_person_2_value_check
females_in_soft_age_range_in_pregnant_household_person_2_value_check females_in_soft_age_range_in_pregnant_household_person_2_value_check
@ -64,11 +68,14 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_2_over_retirement_value_check working_situation_2_over_retirement_value_check
person_3_known person_3_known
person_3_relationship_to_lead person_3_relationship_to_lead
relationship_3_partner_under_16_value_check
relationship_3_multiple_partners_value_check
person_3_age person_3_age
no_females_pregnant_household_person_3_age_value_check no_females_pregnant_household_person_3_age_value_check
females_in_soft_age_range_in_pregnant_household_person_3_age_value_check females_in_soft_age_range_in_pregnant_household_person_3_age_value_check
age_3_under_retirement_value_check age_3_under_retirement_value_check
age_3_over_retirement_value_check age_3_over_retirement_value_check
age_3_partner_under_16_value_check
person_3_gender_identity person_3_gender_identity
no_females_pregnant_household_person_3_value_check no_females_pregnant_household_person_3_value_check
females_in_soft_age_range_in_pregnant_household_person_3_value_check females_in_soft_age_range_in_pregnant_household_person_3_value_check
@ -78,11 +85,14 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_3_over_retirement_value_check working_situation_3_over_retirement_value_check
person_4_known person_4_known
person_4_relationship_to_lead person_4_relationship_to_lead
relationship_4_partner_under_16_value_check
relationship_4_multiple_partners_value_check
person_4_age person_4_age
no_females_pregnant_household_person_4_age_value_check no_females_pregnant_household_person_4_age_value_check
females_in_soft_age_range_in_pregnant_household_person_4_age_value_check females_in_soft_age_range_in_pregnant_household_person_4_age_value_check
age_4_under_retirement_value_check age_4_under_retirement_value_check
age_4_over_retirement_value_check age_4_over_retirement_value_check
age_4_partner_under_16_value_check
person_4_gender_identity person_4_gender_identity
no_females_pregnant_household_person_4_value_check no_females_pregnant_household_person_4_value_check
females_in_soft_age_range_in_pregnant_household_person_4_value_check females_in_soft_age_range_in_pregnant_household_person_4_value_check
@ -92,11 +102,14 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_4_over_retirement_value_check working_situation_4_over_retirement_value_check
person_5_known person_5_known
person_5_relationship_to_lead person_5_relationship_to_lead
relationship_5_partner_under_16_value_check
relationship_5_multiple_partners_value_check
person_5_age person_5_age
no_females_pregnant_household_person_5_age_value_check no_females_pregnant_household_person_5_age_value_check
females_in_soft_age_range_in_pregnant_household_person_5_age_value_check females_in_soft_age_range_in_pregnant_household_person_5_age_value_check
age_5_under_retirement_value_check age_5_under_retirement_value_check
age_5_over_retirement_value_check age_5_over_retirement_value_check
age_5_partner_under_16_value_check
person_5_gender_identity person_5_gender_identity
no_females_pregnant_household_person_5_value_check no_females_pregnant_household_person_5_value_check
females_in_soft_age_range_in_pregnant_household_person_5_value_check females_in_soft_age_range_in_pregnant_household_person_5_value_check
@ -106,11 +119,14 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_5_over_retirement_value_check working_situation_5_over_retirement_value_check
person_6_known person_6_known
person_6_relationship_to_lead person_6_relationship_to_lead
relationship_6_partner_under_16_value_check
relationship_6_multiple_partners_value_check
person_6_age person_6_age
no_females_pregnant_household_person_6_age_value_check no_females_pregnant_household_person_6_age_value_check
females_in_soft_age_range_in_pregnant_household_person_6_age_value_check females_in_soft_age_range_in_pregnant_household_person_6_age_value_check
age_6_under_retirement_value_check age_6_under_retirement_value_check
age_6_over_retirement_value_check age_6_over_retirement_value_check
age_6_partner_under_16_value_check
person_6_gender_identity person_6_gender_identity
no_females_pregnant_household_person_6_value_check no_females_pregnant_household_person_6_value_check
females_in_soft_age_range_in_pregnant_household_person_6_value_check females_in_soft_age_range_in_pregnant_household_person_6_value_check
@ -120,11 +136,14 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_6_over_retirement_value_check working_situation_6_over_retirement_value_check
person_7_known person_7_known
person_7_relationship_to_lead person_7_relationship_to_lead
relationship_7_partner_under_16_value_check
relationship_7_multiple_partners_value_check
person_7_age person_7_age
no_females_pregnant_household_person_7_age_value_check no_females_pregnant_household_person_7_age_value_check
females_in_soft_age_range_in_pregnant_household_person_7_age_value_check females_in_soft_age_range_in_pregnant_household_person_7_age_value_check
age_7_under_retirement_value_check age_7_under_retirement_value_check
age_7_over_retirement_value_check age_7_over_retirement_value_check
age_7_partner_under_16_value_check
person_7_gender_identity person_7_gender_identity
no_females_pregnant_household_person_7_value_check no_females_pregnant_household_person_7_value_check
females_in_soft_age_range_in_pregnant_household_person_7_value_check females_in_soft_age_range_in_pregnant_household_person_7_value_check
@ -134,11 +153,14 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_7_over_retirement_value_check working_situation_7_over_retirement_value_check
person_8_known person_8_known
person_8_relationship_to_lead person_8_relationship_to_lead
relationship_8_partner_under_16_value_check
relationship_8_multiple_partners_value_check
person_8_age person_8_age
no_females_pregnant_household_person_8_age_value_check no_females_pregnant_household_person_8_age_value_check
females_in_soft_age_range_in_pregnant_household_person_8_age_value_check females_in_soft_age_range_in_pregnant_household_person_8_age_value_check
age_8_under_retirement_value_check age_8_under_retirement_value_check
age_8_over_retirement_value_check age_8_over_retirement_value_check
age_8_partner_under_16_value_check
person_8_gender_identity person_8_gender_identity
no_females_pregnant_household_person_8_value_check no_females_pregnant_household_person_8_value_check
females_in_soft_age_range_in_pregnant_household_person_8_value_check females_in_soft_age_range_in_pregnant_household_person_8_value_check
@ -151,9 +173,10 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
end end
end end
context "with start year >= 2024" do context "with start year >= 2025", metadata: { year: 25 } do
before do before do
allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
allow(form).to receive(:start_year_2025_or_later?).and_return(true)
end end
it "has correct pages" do it "has correct pages" do
@ -182,7 +205,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_lead_tenant_under_retirement_value_check working_situation_lead_tenant_under_retirement_value_check
working_situation_lead_tenant_over_retirement_value_check working_situation_lead_tenant_over_retirement_value_check
person_2_known person_2_known
person_2_relationship_to_lead person_2_lead_partner
relationship_2_partner_under_16_value_check relationship_2_partner_under_16_value_check
relationship_2_multiple_partners_value_check relationship_2_multiple_partners_value_check
person_2_age person_2_age
@ -199,7 +222,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_2_under_retirement_value_check working_situation_2_under_retirement_value_check
working_situation_2_over_retirement_value_check working_situation_2_over_retirement_value_check
person_3_known person_3_known
person_3_relationship_to_lead person_3_lead_partner
relationship_3_partner_under_16_value_check relationship_3_partner_under_16_value_check
relationship_3_multiple_partners_value_check relationship_3_multiple_partners_value_check
person_3_age person_3_age
@ -216,7 +239,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_3_under_retirement_value_check working_situation_3_under_retirement_value_check
working_situation_3_over_retirement_value_check working_situation_3_over_retirement_value_check
person_4_known person_4_known
person_4_relationship_to_lead person_4_lead_partner
relationship_4_partner_under_16_value_check relationship_4_partner_under_16_value_check
relationship_4_multiple_partners_value_check relationship_4_multiple_partners_value_check
person_4_age person_4_age
@ -233,7 +256,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_4_under_retirement_value_check working_situation_4_under_retirement_value_check
working_situation_4_over_retirement_value_check working_situation_4_over_retirement_value_check
person_5_known person_5_known
person_5_relationship_to_lead person_5_lead_partner
relationship_5_partner_under_16_value_check relationship_5_partner_under_16_value_check
relationship_5_multiple_partners_value_check relationship_5_multiple_partners_value_check
person_5_age person_5_age
@ -250,7 +273,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_5_under_retirement_value_check working_situation_5_under_retirement_value_check
working_situation_5_over_retirement_value_check working_situation_5_over_retirement_value_check
person_6_known person_6_known
person_6_relationship_to_lead person_6_lead_partner
relationship_6_partner_under_16_value_check relationship_6_partner_under_16_value_check
relationship_6_multiple_partners_value_check relationship_6_multiple_partners_value_check
person_6_age person_6_age
@ -267,7 +290,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_6_under_retirement_value_check working_situation_6_under_retirement_value_check
working_situation_6_over_retirement_value_check working_situation_6_over_retirement_value_check
person_7_known person_7_known
person_7_relationship_to_lead person_7_lead_partner
relationship_7_partner_under_16_value_check relationship_7_partner_under_16_value_check
relationship_7_multiple_partners_value_check relationship_7_multiple_partners_value_check
person_7_age person_7_age
@ -284,7 +307,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
working_situation_7_under_retirement_value_check working_situation_7_under_retirement_value_check
working_situation_7_over_retirement_value_check working_situation_7_over_retirement_value_check
person_8_known person_8_known
person_8_relationship_to_lead person_8_lead_partner
relationship_8_partner_under_16_value_check relationship_8_partner_under_16_value_check
relationship_8_multiple_partners_value_check relationship_8_multiple_partners_value_check
person_8_age person_8_age
@ -305,10 +328,11 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
end end
end end
context "with start year >= 2025" do context "with start year >= 2026", metadata: { year: 26 } do
before do before do
allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(form).to receive(:start_year_2024_or_later?).and_return(true)
allow(form).to receive(:start_year_2025_or_later?).and_return(true) allow(form).to receive(:start_year_2025_or_later?).and_return(true)
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
end end
it "has correct pages" do it "has correct pages" do
@ -336,6 +360,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
lead_tenant_working_situation lead_tenant_working_situation
working_situation_lead_tenant_under_retirement_value_check working_situation_lead_tenant_under_retirement_value_check
working_situation_lead_tenant_over_retirement_value_check working_situation_lead_tenant_over_retirement_value_check
working_situation_lead_tenant_long_term_illness_check
person_2_known person_2_known
person_2_lead_partner person_2_lead_partner
relationship_2_partner_under_16_value_check relationship_2_partner_under_16_value_check
@ -353,6 +378,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_2_working_situation person_2_working_situation
working_situation_2_under_retirement_value_check working_situation_2_under_retirement_value_check
working_situation_2_over_retirement_value_check working_situation_2_over_retirement_value_check
working_situation_2_long_term_illness_check
person_3_known person_3_known
person_3_lead_partner person_3_lead_partner
relationship_3_partner_under_16_value_check relationship_3_partner_under_16_value_check
@ -370,6 +396,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_3_working_situation person_3_working_situation
working_situation_3_under_retirement_value_check working_situation_3_under_retirement_value_check
working_situation_3_over_retirement_value_check working_situation_3_over_retirement_value_check
working_situation_3_long_term_illness_check
person_4_known person_4_known
person_4_lead_partner person_4_lead_partner
relationship_4_partner_under_16_value_check relationship_4_partner_under_16_value_check
@ -387,6 +414,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_4_working_situation person_4_working_situation
working_situation_4_under_retirement_value_check working_situation_4_under_retirement_value_check
working_situation_4_over_retirement_value_check working_situation_4_over_retirement_value_check
working_situation_4_long_term_illness_check
person_5_known person_5_known
person_5_lead_partner person_5_lead_partner
relationship_5_partner_under_16_value_check relationship_5_partner_under_16_value_check
@ -404,6 +432,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_5_working_situation person_5_working_situation
working_situation_5_under_retirement_value_check working_situation_5_under_retirement_value_check
working_situation_5_over_retirement_value_check working_situation_5_over_retirement_value_check
working_situation_5_long_term_illness_check
person_6_known person_6_known
person_6_lead_partner person_6_lead_partner
relationship_6_partner_under_16_value_check relationship_6_partner_under_16_value_check
@ -421,6 +450,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_6_working_situation person_6_working_situation
working_situation_6_under_retirement_value_check working_situation_6_under_retirement_value_check
working_situation_6_over_retirement_value_check working_situation_6_over_retirement_value_check
working_situation_6_long_term_illness_check
person_7_known person_7_known
person_7_lead_partner person_7_lead_partner
relationship_7_partner_under_16_value_check relationship_7_partner_under_16_value_check
@ -438,6 +468,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_7_working_situation person_7_working_situation
working_situation_7_under_retirement_value_check working_situation_7_under_retirement_value_check
working_situation_7_over_retirement_value_check working_situation_7_over_retirement_value_check
working_situation_7_long_term_illness_check
person_8_known person_8_known
person_8_lead_partner person_8_lead_partner
relationship_8_partner_under_16_value_check relationship_8_partner_under_16_value_check
@ -455,6 +486,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
person_8_working_situation person_8_working_situation
working_situation_8_under_retirement_value_check working_situation_8_under_retirement_value_check
working_situation_8_over_retirement_value_check working_situation_8_over_retirement_value_check
working_situation_8_long_term_illness_check
], ],
) )
end end

36
spec/models/form/lettings/subsections/household_needs_spec.rb

@ -8,10 +8,20 @@ RSpec.describe Form::Lettings::Subsections::HouseholdNeeds, type: :model do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:section) { instance_double(Form::Lettings::Sections::Household, form:) } let(:section) { instance_double(Form::Lettings::Sections::Household, form:) }
before do
allow(form).to receive(:start_year_2025_or_later?).and_return(false)
allow(form).to receive(:start_year_2026_or_later?).and_return(false)
end
it "has correct section" do it "has correct section" do
expect(household_needs.section).to eq(section) expect(household_needs.section).to eq(section)
end end
context "with start year >= 2025", metadata: { year: 25 } do
before do
allow(form).to receive(:start_year_2025_or_later?).and_return(true)
end
it "has correct pages" do it "has correct pages" do
expect(household_needs.pages.map(&:id)).to eq( expect(household_needs.pages.map(&:id)).to eq(
%w[ %w[
@ -28,6 +38,32 @@ RSpec.describe Form::Lettings::Subsections::HouseholdNeeds, type: :model do
], ],
) )
end end
end
context "with start year >= 2026", metadata: { year: 26 } do
before do
allow(form).to receive(:start_year_2025_or_later?).and_return(true)
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
end
it "has correct pages" do
expect(household_needs.pages.map(&:id)).to eq(
%w[
armed_forces
armed_forces_serving
armed_forces_injured
pregnant
no_females_pregnant_household_value_check
females_in_soft_age_range_in_pregnant_household_value_check
access_needs_exist
type_of_access_needs
health_conditions
working_situation_long_term_illness_check
health_condition_effects
],
)
end
end
it "has the correct id" do it "has the correct id" do
expect(household_needs.id).to eq("household_needs") expect(household_needs.id).to eq("household_needs")

38
spec/models/validations/soft_validations_spec.rb

@ -1354,4 +1354,42 @@ RSpec.describe Validations::SoftValidations do
expect(record).to be_reasonother_might_be_existing_category expect(record).to be_reasonother_might_be_existing_category
end end
end end
describe "at_least_one_working_situation_is_sickness_and_household_sickness_is_no" do
it "returns true if one person has working situation as illness and household sickness is no" do
record.illness = 2
record.hhmemb = 2
record.ecstat1 = 8
record.ecstat2 = 1
expect(record.at_least_one_working_situation_is_sickness_and_household_sickness_is_no?).to be true
end
it "returns true if all people has working situation as illness and household sickness is no" do
record.illness = 2
record.hhmemb = 2
record.ecstat1 = 8
record.ecstat2 = 8
expect(record.at_least_one_working_situation_is_sickness_and_household_sickness_is_no?).to be true
end
it "returns false if household sickness is yes" do
record.illness = 1
record.hhmemb = 2
record.ecstat1 = 8
record.ecstat2 = 1
expect(record.at_least_one_working_situation_is_sickness_and_household_sickness_is_no?).to be false
end
it "returns false if no working situation is illness" do
record.illness = 2
record.hhmemb = 2
record.ecstat1 = 1
record.ecstat2 = 1
expect(record.at_least_one_working_situation_is_sickness_and_household_sickness_is_no?).to be false
end
end
end end

2
spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb

@ -197,7 +197,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do
field_82: "1", field_82: "1",
field_83: "0", field_83: "0",
field_85: "2", field_85: "3",
field_96: "11", field_96: "11",
field_97: "2", field_97: "2",

Loading…
Cancel
Save