Browse Source

bulk upload handles social housing first time let (#1337)

- this question is present in the web form
- however is not surfaced for bulk upload
- therefore the answer must be inferred
pull/1285/head^2
Phil Lee 2 years ago committed by GitHub
parent
commit
06a48cecda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/services/bulk_upload/lettings/row_parser.rb
  2. 14
      spec/services/bulk_upload/lettings/row_parser_spec.rb

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

@ -776,6 +776,8 @@ private
case rsnvac case rsnvac
when 15, 16, 17 when 15, 16, 17
1 1
else
0
end end
end end

14
spec/services/bulk_upload/lettings/row_parser_spec.rb

@ -186,6 +186,12 @@ RSpec.describe BulkUpload::Lettings::RowParser do
field_80: "1234.56", field_80: "1234.56",
field_87: "1", field_87: "1",
field_88: "234.56", field_88: "234.56",
field_106: "15",
field_99: "0",
field_89: now.day.to_s,
field_90: now.month.to_s,
field_91: now.strftime("%g"),
} }
end end
@ -1154,6 +1160,14 @@ RSpec.describe BulkUpload::Lettings::RowParser do
expect(parser.log.first_time_property_let_as_social_housing).to eq(1) expect(parser.log.first_time_property_let_as_social_housing).to eq(1)
end end
end end
context "when field_106 is not 15, 16, or 17" do
let(:attributes) { { bulk_upload:, field_106: "1" } }
it "sets to 0" do
expect(parser.log.first_time_property_let_as_social_housing).to eq(0)
end
end
end end
describe "#housingneeds" do describe "#housingneeds" do

Loading…
Cancel
Save