Update transfer domain with shared contacts

This commit is contained in:
Oleg Hasjanov 2021-01-23 09:38:22 +02:00 committed by Alex Sherman
parent 0f78989555
commit ccbde76473

View file

@ -25,14 +25,14 @@ class EppDomainTransferRequestTest < EppTestCase
@domain.reload @domain.reload
registrar_id = @domain.registrar.id contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id)
new_contact_2 = Contact.find_by(registrar_id: registrar_id)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count)
assert result_hash[new_contact.id] < 2 assert result_hash[new_contact.id] < 2
result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count)
assert result_hash_codes[contact.code] < 2
end end
# ??????????????????? # ???????????????????
@ -53,13 +53,20 @@ class EppDomainTransferRequestTest < EppTestCase
@domain.reload @domain.reload
contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id)
contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count)
assert result_hash[new_contact.id] < 2 assert result_hash[new_contact.id] < 2
result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count)
assert result_hash_codes[contact_one.code] < 2
assert result_hash_codes[contact_two.code] < 2
end end
def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared
contact_id = @domain.domain_contacts[0].contact_id contact_id = @domain.domain_contacts[0].contact_id
@domain.domain_contacts[1].update!(contact_id: contact_id) @domain.domain_contacts[1].update!(contact_id: contact_id)