mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
added more scenarios
This commit is contained in:
parent
21fc5edb44
commit
90e97aeddd
1 changed files with 55 additions and 2 deletions
|
@ -12,11 +12,65 @@ class EppDomainTransferRequestTest < EppTestCase
|
|||
Setting.transfer_wait_time = @original_transfer_wait_time
|
||||
end
|
||||
|
||||
def test_new_contacts_should_be_created_after_transfer_domain
|
||||
def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared
|
||||
registrar_id = @domain.registrar.id
|
||||
|
||||
new_contact = Contact.find_by(registrar_id: registrar_id)
|
||||
|
||||
@domain.domain_contacts[1].update!(contact_id: new_contact.id)
|
||||
|
||||
puts @domain.domain_contacts[1].contact_id
|
||||
|
||||
post epp_transfer_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
|
||||
@domain.reload
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
||||
puts @domain.domain_contacts[1].contact_id
|
||||
|
||||
result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count)
|
||||
assert_equal result_hash[new_contact.id], 1
|
||||
end
|
||||
|
||||
def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared
|
||||
registrar_id = @domain.registrar.id
|
||||
|
||||
new_contact = Contact.find_by(registrar_id: registrar_id)
|
||||
|
||||
@domain.domain_contacts[0].update!(contact_id: new_contact.id)
|
||||
|
||||
post epp_transfer_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
|
||||
@domain.reload
|
||||
|
||||
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], 1
|
||||
end
|
||||
|
||||
def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared
|
||||
|
||||
contact_id = @domain.domain_contacts[0].contact_id
|
||||
@domain.domain_contacts[1].update!(contact_id: contact_id)
|
||||
|
||||
post epp_transfer_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
|
||||
@domain.reload
|
||||
|
||||
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
|
||||
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)
|
||||
|
||||
@domain.domain_contacts[0].update!(contact_id: new_contact.id)
|
||||
@domain.domain_contacts[1].update!(contact_id: new_contact.id)
|
||||
|
||||
|
@ -26,7 +80,6 @@ class EppDomainTransferRequestTest < EppTestCase
|
|||
@domain.reload
|
||||
|
||||
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
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue