Browse Source

Add unittype question

pull/1148/head
Kat 3 years ago committed by Phil Lee
parent
commit
a06deb7d3b
  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: [], needstype: [],
rent_type: %i[field_1 field_129 field_130], rent_type: %i[field_1 field_129 field_130],
startdate: %i[field_98 field_97 field_96], startdate: %i[field_98 field_97 field_96],
unittype_gn: %i[field_102],
} }
end end
@ -284,6 +285,7 @@ private
attributes["needstype"] = bulk_upload.needstype attributes["needstype"] = bulk_upload.needstype
attributes["rent_type"] = rent_type attributes["rent_type"] = rent_type
attributes["startdate"] = startdate attributes["startdate"] = startdate
attributes["unittype_gn"] = field_102
attributes attributes
end end

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

@ -18,6 +18,9 @@ RSpec.describe BulkUpload::Lettings::RowParser do
describe "validations" do describe "validations" do
before 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? parser.valid?
end end
@ -46,6 +49,7 @@ RSpec.describe BulkUpload::Lettings::RowParser do
field_113: managing_org.old_visible_id, field_113: managing_org.old_visible_id,
field_130: "1", field_130: "1",
field_134: "0", field_134: "0",
field_102: "2",
} }
end end

Loading…
Cancel
Save