Browse Source

add #reasonother to bulk upload

remotes/origin/bulk-upload-errors-integration
Phil Lee 3 years ago
parent
commit
6065b61866
  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

@ -293,6 +293,7 @@ private
layear: %i[field_66],
waityear: %i[field_67],
reason: %i[field_52],
reasonother: %i[field_53],
prevten: %i[field_61],
homeless: %i[field_68],
@ -481,6 +482,7 @@ private
attributes["layear"] = field_66
attributes["waityear"] = field_67
attributes["reason"] = field_52
attributes["reasonother"] = field_53
attributes["prevten"] = field_61
attributes["homeless"] = homeless

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

@ -557,5 +557,13 @@ RSpec.describe BulkUpload::Lettings::RowParser do
expect(parser.log.earnings).to eq(105)
end
end
describe "#reasonother" do
let(:attributes) { { bulk_upload:, field_53: "some other reason" } }
it "sets value to given free text string" do
expect(parser.log.reasonother).to eql("some other reason")
end
end
end
end

Loading…
Cancel
Save