Browse Source

add #tenancylength to bulk upload

pull/1148/head
Phil Lee 3 years ago
parent
commit
da1445db32
  1. 2
      app/services/bulk_upload/lettings/row_parser.rb
  2. 8
      spec/services/bulk_upload/lettings/row_parser_spec.rb

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

@ -230,6 +230,7 @@ private
startertenancy: %i[field_8],
tenancy: %i[field_9],
tenancyother: %i[field_10],
tenancylength: %i[field_11],
declaration: %i[field_132],
age1_known: %i[field_12],
@ -409,6 +410,7 @@ private
attributes["startertenancy"] = field_8
attributes["tenancy"] = field_9
attributes["tenancyother"] = field_10
attributes["tenancylength"] = field_11
attributes["declaration"] = field_132
attributes["age1_known"] = field_12.present? ? 0 : 1

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

@ -541,5 +541,13 @@ RSpec.describe BulkUpload::Lettings::RowParser do
expect(parser.log.tenancyother).to eql("some other tenancy")
end
end
describe "#tenancylength" do
let(:attributes) { { bulk_upload:, field_11: "2" } }
it "sets value to given free text string" do
expect(parser.log.tenancylength).to eq(2)
end
end
end
end

Loading…
Cancel
Save