mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Fix error on birthday contact creation validation fail
This commit is contained in:
parent
82c048b316
commit
194489e40f
2 changed files with 37 additions and 1 deletions
|
@ -2,7 +2,7 @@ xml.epp_head do
|
||||||
xml.response do
|
xml.response do
|
||||||
@errors.each do |error|
|
@errors.each do |error|
|
||||||
x = error&.options
|
x = error&.options
|
||||||
next if x.empty? || x == { value: nil }
|
next if x.empty? || x == { value: nil } || x[:code].blank?
|
||||||
|
|
||||||
xml.result('code' => x[:code]) do
|
xml.result('code' => x[:code]) do
|
||||||
xml.msg(x[:msg], 'lang' => 'en')
|
xml.msg(x[:msg], 'lang' => 'en')
|
||||||
|
|
|
@ -41,6 +41,42 @@ class EppContactCreateBaseTest < EppTestCase
|
||||||
assert_not_empty contact.code
|
assert_not_empty contact.code
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_responses_with_error_on_birthday
|
||||||
|
name = 'new'
|
||||||
|
email = 'new@registrar.test'
|
||||||
|
phone = '+1.2'
|
||||||
|
|
||||||
|
request_xml = <<-XML
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||||
|
<command>
|
||||||
|
<create>
|
||||||
|
<contact:create xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
|
||||||
|
<contact:postalInfo>
|
||||||
|
<contact:name>#{name}</contact:name>
|
||||||
|
</contact:postalInfo>
|
||||||
|
<contact:voice>#{phone}</contact:voice>
|
||||||
|
<contact:email>#{email}</contact:email>
|
||||||
|
</contact:create>
|
||||||
|
</create>
|
||||||
|
<extension>
|
||||||
|
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||||
|
<eis:ident type="birthday" cc="LV">31-12-2000</eis:ident>
|
||||||
|
</eis:extdata>
|
||||||
|
</extension>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
|
||||||
|
|
||||||
|
assert_no_difference 'Contact.count' do
|
||||||
|
post epp_create_path, params: { frame: request_xml },
|
||||||
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_epp_response :parameter_value_syntax_error
|
||||||
|
end
|
||||||
|
|
||||||
def test_responces_error_with_email_error
|
def test_responces_error_with_email_error
|
||||||
name = 'new'
|
name = 'new'
|
||||||
email = 'new@registrar@test'
|
email = 'new@registrar@test'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue