diff --git a/test/integration/epp/domain/create/base_test.rb b/test/integration/epp/domain/create/base_test.rb index 35ef38179..fa04fc707 100644 --- a/test/integration/epp/domain/create/base_test.rb +++ b/test/integration/epp/domain/create/base_test.rb @@ -46,6 +46,109 @@ class EppDomainCreateBaseTest < EppTestCase assert_epp_response :parameter_value_syntax_error end + def test_too_small_legal_document + name = "new.#{dns_zones(:one).origin}" + contact = contacts(:john) + registrant = contact.becomes(Registrant) + + request_xml = <<-XML + + + + + + #{name} + #{registrant.code} + + + + + #{'test' * 2} + + + + + XML + assert_no_difference 'Domain.count' do + post epp_create_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + end + + assert_epp_response :parameter_value_policy_error + end + + def test_too_big_legal_document + name = "new.#{dns_zones(:one).origin}" + contact = contacts(:john) + registrant = contact.becomes(Registrant) + + # 8388608 bites == 8 mb + bignum_legaldoc = 't' * 8388608 + bignum_legaldoc+= "t" + + request_xml = <<-XML + + + + + + #{name} + #{registrant.code} + + + + + #{bignum_legaldoc} + + + + + XML + + assert_no_difference 'Domain.count' do + post epp_create_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + end + + assert_epp_response :parameter_value_policy_error + end + + def test_upper_limit_of_value_legal_document + name = "new.#{dns_zones(:one).origin}" + contact = contacts(:john) + registrant = contact.becomes(Registrant) + + # 8388608 bites == 8 mb + bignum_legaldoc = 't' * 8388608 + + request_xml = <<-XML + + + + + + #{name} + #{registrant.code} + + + + + #{bignum_legaldoc} + + + + + XML + + assert_difference 'Domain.count' do + post epp_create_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + end + + assert_epp_response :completed_successfully + end + + def test_not_registers_domain_without_legaldoc now = Time.zone.parse('2010-07-05')