Browse Source

CLDC-4363: Update lettings log derived fields

CLDC-4363-check-tests-will-pass-at-end-of-crossover-period
samyou-softwire 3 days ago
parent
commit
3625394150
  1. 39
      spec/models/lettings_log_derived_fields_spec.rb

39
spec/models/lettings_log_derived_fields_spec.rb

@ -111,45 +111,6 @@ RSpec.describe LettingsLog, type: :model do
end
describe "deriving household member fields" do
context "when it is 2024", metadata: { year: 24 } do
let(:startdate) { collection_start_date_for_year(2024) }
before do
log.assign_attributes(
relat2: "X",
relat3: "C",
relat4: "X",
relat5: "C",
relat7: "C",
relat8: "X",
age1: 22,
age2: 16,
age4: 60,
age6: 88,
age7: 14,
age8: 42,
)
log.set_derived_fields!
end
it "correctly derives totchild" do
expect(log.totchild).to eq 3
end
it "correctly derives totelder" do
expect(log.totelder).to eq 2
end
it "correctly derives totadult" do
expect(log.totadult).to eq 3
end
it "correctly derives economic status for tenants under 16" do
expect(log.ecstat7).to eq 9
end
end
context "when it is 2025", metadata: { year: 25 } do
let(:startdate) { collection_start_date_for_year(2025) }

Loading…
Cancel
Save