diff --git a/app/helpers/epp/contacts_helper.rb b/app/helpers/epp/contacts_helper.rb index 07d43ad7e..ee2afcad4 100644 --- a/app/helpers/epp/contacts_helper.rb +++ b/app/helpers/epp/contacts_helper.rb @@ -120,7 +120,9 @@ module Epp::ContactsHelper contact_hash = contact_hash.merge({ address_attributes: { country_id: Country.find_by(iso: ph[:postalInfo][:addr][:cc]), - street: tidy_street, + street: ph[:postalInfo][:addr][:street][0], + street2: ph[:postalInfo][:addr][:street][1], + street3: ph[:postalInfo][:addr][:street][2], zip: ph[:postalInfo][:addr][:pc] } }) if ph[:postalInfo].is_a?(Hash) && ph[:postalInfo][:addr].is_a?(Hash) @@ -135,16 +137,6 @@ module Epp::ContactsHelper return false end - def tidy_street - command = params[:command] - street = params_hash['epp']['command'][command][command][:postalInfo][:addr][:street] - return street if street.is_a? String - return street.join(',') if street.is_a? Array - return nil - rescue NoMethodError => e #refactor so wouldn't use rescue for flow control - return nil - end - def ident_type result = params[:frame].slice(/(?<=\ + + + + + + + ABC-12345 + + diff --git a/spec/epp/requests/contacts/delete_missing_attr.xml b/spec/epp/requests/contacts/delete_missing_attr.xml new file mode 100644 index 000000000..cf8279789 --- /dev/null +++ b/spec/epp/requests/contacts/delete_missing_attr.xml @@ -0,0 +1,11 @@ + + + + + + + + ABC-12345 + + diff --git a/spec/epp/requests/contacts/info_missing_attr.xml b/spec/epp/requests/contacts/info_missing_attr.xml new file mode 100644 index 000000000..3fc5f54d7 --- /dev/null +++ b/spec/epp/requests/contacts/info_missing_attr.xml @@ -0,0 +1,11 @@ + + + + + + + + ABC-12345 + + diff --git a/spec/fabricators/address_fabricator.rb b/spec/fabricators/address_fabricator.rb index 77ab56d34..ef760f331 100644 --- a/spec/fabricators/address_fabricator.rb +++ b/spec/fabricators/address_fabricator.rb @@ -1,5 +1,6 @@ Fabricator(:address) do city Faker::Address.city street Faker::Address.street_name + street Faker::Address.street_name zip Faker::Address.zip end