Update transfer domain with shared contacts

This commit is contained in:
Oleg Hasjanov 2021-01-23 12:09:27 +02:00 committed by Alex Sherman
parent f0ca552cc1
commit a1815314ce

View file

@ -89,27 +89,31 @@ class EppDomainTransferRequestTest < EppTestCase
assert_equal @contact.ident, contact_fresh.ident
end
# def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared
# registrar_id = @domain.registrar.id
# new_contact = Contact.find_by(registrar_id: registrar_id)
def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared
registrar_id = @domain.registrar.id
contact = Contact.find_by(registrar_id: registrar_id)
# @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id)
# @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id)
@domain.admin_domain_contacts[0].update!(contact_id: contact.id)
@domain.tech_domain_contacts[0].update!(contact_id: contact.id)
# post epp_transfer_path, params: { frame: request_xml },
# headers: { 'HTTP_COOKIE' => 'session=api_goodnames' }
post epp_transfer_path, params: { frame: request_xml },
headers: { 'HTTP_COOKIE' => 'session=api_goodnames' }
# @domain.reload
@domain.reload
# contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id)
contact_fresh = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id)
# assert_epp_response :completed_successfully
# result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count)
# assert_equal result_hash[new_contact.id], 2
assert_epp_response :completed_successfully
result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count)
assert_equal result_hash[contact.id], 2
# result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count)
# assert result_hash_codes[contact.code] > 1
# end
result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count)
assert result_hash_codes[contact_fresh.code] > 1
assert_equal contact.phone, contact_fresh.phone
assert_equal contact.name, contact_fresh.name
assert_equal contact.ident, contact_fresh.ident
end
def test_transfers_domain_at_once
post epp_transfer_path, params: { frame: request_xml },