diff --git a/app/views/epp/error.xml.builder b/app/views/epp/error.xml.builder index be6b94a6a..36a1469a8 100644 --- a/app/views/epp/error.xml.builder +++ b/app/views/epp/error.xml.builder @@ -2,7 +2,7 @@ xml.epp_head do xml.response do @errors.each do |error| 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.msg(x[:msg], 'lang' => 'en') diff --git a/test/integration/epp/contact/create/base_test.rb b/test/integration/epp/contact/create/base_test.rb index 262487a1e..06087aaa8 100644 --- a/test/integration/epp/contact/create/base_test.rb +++ b/test/integration/epp/contact/create/base_test.rb @@ -41,6 +41,42 @@ class EppContactCreateBaseTest < EppTestCase assert_not_empty contact.code end + def test_responses_with_error_on_birthday + name = 'new' + email = 'new@registrar.test' + phone = '+1.2' + + request_xml = <<-XML + + + + + + + #{name} + + #{phone} + #{email} + + + + + 31-12-2000 + + + + + 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 name = 'new' email = 'new@registrar@test'