mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
parent
bb108efedd
commit
fa52001be6
141 changed files with 1388 additions and 1664 deletions
|
@ -14,7 +14,8 @@ class EppContactBaseTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_info_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_epp_response :object_does_not_exist
|
||||
end
|
||||
|
|
|
@ -21,7 +21,8 @@ class EppContactCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -42,7 +43,8 @@ class EppContactCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '1', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail']
|
||||
|
@ -65,7 +67,8 @@ class EppContactCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '0', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail']
|
||||
|
@ -88,7 +91,8 @@ class EppContactCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal 3, response_xml.xpath('//contact:cd', contact: xml_schema).size
|
||||
|
|
|
@ -29,7 +29,8 @@ class EppContactCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Contact.count' do
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
end
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -68,7 +69,8 @@ class EppContactCreateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}"
|
||||
post epp_create_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
|
||||
|
||||
contact = Contact.find_by(name: name)
|
||||
assert_equal "#{session.user.registrar.code}:#{code}".upcase, contact.code
|
||||
|
@ -98,7 +100,8 @@ class EppContactCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Contact.count' do
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
end
|
||||
assert_epp_response :required_parameter_missing
|
||||
end
|
||||
|
|
|
@ -21,7 +21,8 @@ class EppContactDeleteBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Contact.count', -1 do
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
end
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
@ -47,7 +48,8 @@ class EppContactDeleteBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Contact.count' do
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
end
|
||||
assert_epp_response :object_association_prohibits_operation
|
||||
end
|
||||
|
@ -55,7 +57,7 @@ class EppContactDeleteBaseTest < EppTestCase
|
|||
private
|
||||
|
||||
def deletable_contact
|
||||
Domain.update_all(registrant_id: contacts(:william))
|
||||
Domain.update_all(registrant_id: contacts(:william).id)
|
||||
DomainContact.delete_all
|
||||
contacts(:john)
|
||||
end
|
||||
|
|
|
@ -29,7 +29,8 @@ class EppContactInfoBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_info_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
|
|
@ -16,7 +16,8 @@ class EppContactTransferBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_transfer_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_transfer_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_epp_response :unimplemented
|
||||
end
|
||||
|
|
|
@ -37,7 +37,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
@contact.reload
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -69,7 +70,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_emails 1
|
||||
end
|
||||
|
@ -97,7 +99,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_no_emails
|
||||
end
|
||||
|
@ -128,7 +131,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_no_emails
|
||||
end
|
||||
|
@ -154,7 +158,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_epp_response :object_does_not_exist
|
||||
end
|
||||
|
@ -188,7 +193,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
assert_no_changes -> { @contact.updated_at } do
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
end
|
||||
assert_epp_response :data_management_policy_violation
|
||||
end
|
||||
|
@ -220,7 +226,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
@ -230,6 +237,6 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
def make_contact_free_of_domains_where_it_acts_as_a_registrant(contact)
|
||||
other_contact = contacts(:william)
|
||||
assert_not_equal other_contact, contact
|
||||
Domain.update_all(registrant_id: other_contact)
|
||||
Domain.update_all(registrant_id: other_contact.id)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue