From 63c8db4cf6ece4392980a206bbecb30e88046fc6 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 20 Jan 2021 15:01:25 +0200 Subject: [PATCH] Type test for #39 ticket: Registrant confirmation should not be asked if new object has identical ident data --- .../epp/domain/update/base_test.rb | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/test/integration/epp/domain/update/base_test.rb b/test/integration/epp/domain/update/base_test.rb index 14e806fca..7ddcb35ad 100644 --- a/test/integration/epp/domain/update/base_test.rb +++ b/test/integration/epp/domain/update/base_test.rb @@ -5,6 +5,7 @@ class EppDomainUpdateBaseTest < EppTestCase setup do @domain = domains(:shop) + @contact = contacts(:john) @original_registrant_change_verification = Setting.request_confirmation_on_registrant_change_enabled ActionMailer::Base.deliveries.clear @@ -225,6 +226,49 @@ class EppDomainUpdateBaseTest < EppTestCase Setting.legal_document_is_mandatory = old_value end + # ================================================================ + def test_domain_should_not_padding_if_registrant_update_with_same_ident + Setting.request_confirmation_on_registrant_change_enabled = true + + current = @domain.registrant + new_registrant = contacts(:william) + new_registrant.update( + ident: current.ident, + ident_type: current.ident_type, + ident_country_code: current.ident_country_code + ) + + request_xml = <<-XML + + + + + + #{@domain.name} + + #{new_registrant.code} + + + + + + #{'test' * 2000} + + + + + XML + + post epp_update_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + @domain.reload + + # NOTE: completed_successfully_action_pending + assert_epp_response :completed_successfully + refute_includes @domain.statuses, DomainStatus::PENDING_UPDATE + + end + def test_skips_verification_when_provided_registrant_is_the_same_as_current_one Setting.request_confirmation_on_registrant_change_enabled = true