diff --git a/app/helpers/epp/contacts_helper.rb b/app/helpers/epp/contacts_helper.rb index d5b6868b0..5647774a9 100644 --- a/app/helpers/epp/contacts_helper.rb +++ b/app/helpers/epp/contacts_helper.rb @@ -12,6 +12,7 @@ module Epp::ContactsHelper ) end @contact.name = ph[:postalInfo][:name] + @contact.ident_type = ident_type @contact.addresses << Address.new( country_id: Country.find_by(iso: ph[:postalInfo][:cc]), @@ -53,4 +54,16 @@ module Epp::ContactsHelper render 'epp/error' end end + + private + + def ident_type + result = params[:frame].slice(/(?<=\ - - - + + + + + + + + + + + + + + diff --git a/spec/epp/contact_spec.rb b/spec/epp/contact_spec.rb index d9c7222da..c999336b3 100644 --- a/spec/epp/contact_spec.rb +++ b/spec/epp/contact_spec.rb @@ -24,6 +24,7 @@ describe 'EPP Contact', epp: true do expect(response[:clTRID]).to eq('ABC-12345') expect(Contact.first.name).to eq("John Doe") + expect(Contact.first.ident_type).to eq("op") expect(Contact.count).to eq(1) end diff --git a/spec/epp/requests/contacts/create.xml b/spec/epp/requests/contacts/create.xml index 3774a2706..7ba35fc83 100644 --- a/spec/epp/requests/contacts/create.xml +++ b/spec/epp/requests/contacts/create.xml @@ -20,7 +20,7 @@ +123.7035555555 +1.7035555556 jdoe@example.com - 37605030299 + 37605030299 2fooBAR diff --git a/spec/fabricators/contact_fabricator.rb b/spec/fabricators/contact_fabricator.rb index 61b40ae45..38b842113 100644 --- a/spec/fabricators/contact_fabricator.rb +++ b/spec/fabricators/contact_fabricator.rb @@ -4,4 +4,5 @@ Fabricator(:contact) do email Faker::Internet.email ident '37605030299' code 'sh8913' + ident_type 'op' end