Browse Source

Add unittype question

remotes/origin/bulk-upload-errors-integration
Kat 3 years ago
parent
commit
d9f38f5f81
  1. 2
      app/services/bulk_upload/lettings/row_parser.rb
  2. 4
      spec/services/bulk_upload/lettings/row_parser_spec.rb

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

@ -221,6 +221,7 @@ private
needstype: [],
rent_type: %i[field_1 field_129 field_130],
startdate: %i[field_98 field_97 field_96],
unittype_gn: %i[field_102],
}
end
@ -284,6 +285,7 @@ private
attributes["needstype"] = bulk_upload.needstype
attributes["rent_type"] = rent_type
attributes["startdate"] = startdate
attributes["unittype_gn"] = field_102
attributes
end

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

@ -18,6 +18,9 @@ RSpec.describe BulkUpload::Lettings::RowParser do
describe "validations" do
before do
stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {})
parser.valid?
end
@ -46,6 +49,7 @@ RSpec.describe BulkUpload::Lettings::RowParser do
field_113: managing_org.old_visible_id,
field_130: "1",
field_134: "0",
field_102: "2",
}
end

Loading…
Cancel
Save