Browse Source

Do not backfill information about people indexed 7 and higher

pull/1454/head
Kat 3 years ago
parent
commit
890b2c07da
  1. 2
      app/services/imports/sales_logs_import_service.rb
  2. 14
      spec/services/imports/sales_logs_import_service_spec.rb

2
app/services/imports/sales_logs_import_service.rb

@ -555,7 +555,7 @@ module Imports
end end
# other household members characteristics # other household members characteristics
(2..attributes["hhmemb"]).each do |index| (2..[attributes["hhmemb"], 6].min).each do |index|
attributes["age#{index}_known"] ||= 1 attributes["age#{index}_known"] ||= 1
attributes["sex#{index}"] ||= "R" attributes["sex#{index}"] ||= "R"
attributes["ecstat#{index}"] ||= 10 attributes["ecstat#{index}"] ||= 10

14
spec/services/imports/sales_logs_import_service_spec.rb

@ -593,6 +593,20 @@ RSpec.describe Imports::SalesLogsImportService do
end end
end end
xcontext "when there is information about 7 people" do
let(:sales_log_id) { "shared_ownership_sales_log" }
before do
sales_log_xml.at_xpath("//xmlns:P7Age").content = "22"
sales_log_xml.at_xpath("//xmlns:LiveInOther").content = "10"
end
it "does not try to save information about person 7" do
expect { sales_log_service.send(:create_log, sales_log_xml) }
.not_to raise_error
end
end
context "and it has an invalid record with invalid contracts exchange date" do context "and it has an invalid record with invalid contracts exchange date" do
let(:sales_log_id) { "shared_ownership_sales_log" } let(:sales_log_id) { "shared_ownership_sales_log" }

Loading…
Cancel
Save