* Fix household members * Add test
@ -432,9 +432,11 @@ module Imports
end
def household_members(_xml_doc, attributes)
return attributes["hholdcount"] + 2 if attributes["jointpur"] == 1
attributes["hholdcount"] + 1 if attributes["jointpur"] == 2
if attributes["jointpur"] == 2
attributes["hholdcount"] + 1
else
attributes["hholdcount"] + 2
def set_default_values(attributes)
@ -604,6 +604,13 @@ RSpec.describe Imports::SalesLogsImportService do
sales_log = SalesLog.find_by(old_id: sales_log_id)
expect(sales_log&.hholdcount).to eq(0)
it "doesn't hang if jointpur is not given" do
sales_log_xml.at_xpath("//xmlns:joint").content = ""
sales_log_xml.at_xpath("//xmlns:HHMEMB").content = "0"
sales_log_service.send(:create_log, sales_log_xml)
context "when inferring income used" do