Browse Source

Merge branch 'main' into CLDC-3116-create-blank-homepage

pull/2115/head
natdeanlewissoftwire 12 months ago
parent
commit
273c597f38
  1. 2
      app/services/bulk_upload/lettings/year2023/row_parser.rb
  2. 12
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

2
app/services/bulk_upload/lettings/year2023/row_parser.rb

@ -1193,7 +1193,7 @@ private
attributes["tcharge"] = field_132
attributes["chcharge"] = field_127
attributes["is_carehome"] = field_127.present? ? 1 : 0
attributes["household_charge"] = field_125
attributes["household_charge"] = supported_housing? ? field_125 : nil
attributes["hbrentshortfall"] = field_133
attributes["tshortfall_known"] = tshortfall_known
attributes["tshortfall"] = field_134

12
spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

@ -2258,12 +2258,22 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
end
describe "#household_charge" do
let(:attributes) { { bulk_upload:, field_125: "1" } }
context "when log is general needs" do
let(:attributes) { { bulk_upload:, field_4: 1, field_125: "1" } }
it "sets correct value from mapping" do
expect(parser.log.household_charge).to eq(nil)
end
end
context "when log is supported housing" do
let(:attributes) { { bulk_upload:, field_4: 2, field_125: "1" } }
it "sets correct value from mapping" do
expect(parser.log.household_charge).to eq(1)
end
end
end
describe "#chcharge" do
let(:attributes) { { bulk_upload:, field_127: "123.45" } }

Loading…
Cancel
Save