mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
List EPP routes explicitly
This commit is contained in:
parent
ddaf9c9cbf
commit
cb3bf7ffdc
26 changed files with 145 additions and 120 deletions
|
@ -1,14 +1,39 @@
|
|||
require_dependency 'epp_constraint'
|
||||
|
||||
Rails.application.routes.draw do
|
||||
namespace(:epp, defaults: { format: :xml }) do
|
||||
match 'session/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session)
|
||||
# https://github.com/internetee/epp_proxy#translation-of-epp-calls
|
||||
namespace :epp do
|
||||
constraints(EppConstraint.new(:session)) do
|
||||
get 'session/hello', to: 'sessions#hello', as: 'hello'
|
||||
post 'session/login', to: 'sessions#login', as: 'login'
|
||||
post 'session/logout', to: 'sessions#logout', as: 'logout'
|
||||
end
|
||||
|
||||
post 'command/:action', controller: 'domains', constraints: EppConstraint.new(:domain)
|
||||
post 'command/:action', controller: 'contacts', constraints: EppConstraint.new(:contact)
|
||||
post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll)
|
||||
post 'command/keyrelay', to: 'keyrelays#keyrelay', constraints: EppConstraint.new(:keyrelay)
|
||||
constraints(EppConstraint.new(:contact)) do
|
||||
controller('contacts') do
|
||||
post 'command/create', action: 'create', as: :create
|
||||
post 'command/update', action: 'update', as: :update
|
||||
post 'command/info', action: 'info', as: :info
|
||||
post 'command/check', action: 'check', as: :check
|
||||
post 'command/transfer', action: 'transfer', as: :transfer
|
||||
post 'command/renew', action: 'renew', as: :renew
|
||||
post 'command/delete', action: 'delete', as: :delete
|
||||
end
|
||||
end
|
||||
|
||||
constraints(EppConstraint.new(:domain)) do
|
||||
controller('domains') do
|
||||
post 'command/create', action: 'create', as: nil
|
||||
post 'command/update', action: 'update', as: nil
|
||||
post 'command/info', action: 'info', as: nil
|
||||
post 'command/check', action: 'check', as: nil
|
||||
post 'command/transfer', action: 'transfer', as: nil
|
||||
post 'command/renew', action: 'renew', as: nil
|
||||
post 'command/delete', action: 'delete', as: nil
|
||||
end
|
||||
end
|
||||
|
||||
post 'command/poll', to: 'polls#poll', as: 'poll', constraints: EppConstraint.new(:poll)
|
||||
get 'error/:command', to: 'errors#error'
|
||||
end
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class EppBaseTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/info', { frame: xml_of_epp_command_that_requires_authentication },
|
||||
post epp_info_path, { frame: xml_of_epp_command_that_requires_authentication },
|
||||
'HTTP_COOKIE' => 'session=non-existent'
|
||||
|
||||
assert_epp_response :authorization_error
|
||||
|
@ -74,7 +74,7 @@ class EppBaseTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/info', { frame: xml_of_epp_command_that_requires_authorization },
|
||||
post epp_info_path, { frame: xml_of_epp_command_that_requires_authorization },
|
||||
'HTTP_COOKIE' => "session=#{session.session_id}"
|
||||
|
||||
assert_epp_response :authorization_error
|
||||
|
@ -83,7 +83,7 @@ class EppBaseTest < EppTestCase
|
|||
private
|
||||
|
||||
def valid_command_path
|
||||
epp_command_poll_path
|
||||
epp_poll_path
|
||||
end
|
||||
|
||||
def valid_request_xml
|
||||
|
|
|
@ -14,7 +14,7 @@ class EppContactBaseTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :object_does_not_exist
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ class EppContactCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -42,7 +42,7 @@ class EppContactCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, '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 +65,7 @@ class EppContactCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, '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 +88,7 @@ class EppContactCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, '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,7 @@ class EppContactCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Contact.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -68,7 +68,7 @@ class EppContactCreateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}"
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}"
|
||||
|
||||
contact = Contact.find_by(name: name)
|
||||
assert_equal "#{session.user.registrar.code}:#{code}".upcase, contact.code
|
||||
|
@ -98,7 +98,7 @@ class EppContactCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Contact.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :required_parameter_missing
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ class EppContactDeleteBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Contact.count', -1 do
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
@ -47,7 +47,7 @@ class EppContactDeleteBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Contact.count' do
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :object_association_prohibits_operation
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ class EppContactInfoBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
|
|
@ -37,7 +37,7 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@contact.reload
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -69,7 +69,7 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_emails 1
|
||||
end
|
||||
|
@ -97,7 +97,7 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_no_emails
|
||||
end
|
||||
|
@ -128,7 +128,7 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_no_emails
|
||||
end
|
||||
|
@ -154,7 +154,7 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :object_does_not_exist
|
||||
end
|
||||
|
@ -188,7 +188,7 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
assert_no_changes -> { @contact.updated_at } do
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :data_management_policy_violation
|
||||
end
|
||||
|
@ -220,7 +220,7 @@ class EppContactUpdateBaseTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ class EppDomainBaseTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :object_does_not_exist
|
||||
end
|
||||
|
|
|
@ -28,7 +28,7 @@ class EppDomainCheckAuctionTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -52,7 +52,7 @@ class EppDomainCheckAuctionTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -76,7 +76,7 @@ class EppDomainCheckAuctionTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -100,7 +100,7 @@ class EppDomainCheckAuctionTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -124,7 +124,7 @@ class EppDomainCheckAuctionTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
|
|
@ -15,7 +15,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -36,7 +36,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
|
||||
|
@ -59,7 +59,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
|
||||
|
@ -80,7 +80,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
|
||||
|
@ -103,7 +103,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
|
||||
|
@ -126,7 +126,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
|
||||
|
@ -149,7 +149,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
|
||||
|
@ -172,7 +172,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').size
|
||||
|
|
|
@ -39,7 +39,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
refute Domain.where(name: @idn_auction.domain).exists?
|
||||
|
@ -73,7 +73,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
refute Domain.where(name: @idn_auction.domain).exists?
|
||||
|
@ -106,7 +106,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
refute Domain.where(name: @idn_auction.domain).exists?
|
||||
|
@ -139,7 +139,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
refute Domain.where(name: @idn_auction.domain).exists?
|
||||
|
@ -176,7 +176,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
@idn_auction.reload
|
||||
|
@ -212,7 +212,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
@idn_auction.reload
|
||||
|
|
|
@ -31,7 +31,7 @@ class EppDomainCreateAuctionTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
@ -68,7 +68,7 @@ class EppDomainCreateAuctionTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
@ -100,7 +100,7 @@ class EppDomainCreateAuctionTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
@auction.reload
|
||||
|
@ -132,7 +132,7 @@ class EppDomainCreateAuctionTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :required_parameter_missing
|
||||
end
|
||||
|
@ -164,7 +164,7 @@ class EppDomainCreateAuctionTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :invalid_authorization_information
|
||||
end
|
||||
|
@ -195,7 +195,7 @@ class EppDomainCreateAuctionTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :required_parameter_missing
|
||||
end
|
||||
|
@ -222,7 +222,7 @@ class EppDomainCreateAuctionTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :parameter_value_policy_error
|
||||
end
|
||||
|
|
|
@ -27,7 +27,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -68,7 +68,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :completed_successfully
|
||||
|
||||
|
@ -102,7 +102,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
assert_equal transfer_code, Domain.find_by(name: name).transfer_code
|
||||
|
@ -132,7 +132,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :data_management_policy_violation
|
||||
end
|
||||
|
@ -161,7 +161,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :invalid_authorization_information
|
||||
end
|
||||
|
@ -189,7 +189,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :required_parameter_missing
|
||||
end
|
||||
|
@ -217,7 +217,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}"
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}"
|
||||
end
|
||||
assert_epp_response :billing_failure
|
||||
end
|
||||
|
@ -245,7 +245,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :billing_failure
|
||||
end
|
||||
|
|
|
@ -34,7 +34,7 @@ class EppDomainDeleteBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
assert_includes Domain.find_by(name: 'invalid.test').statuses, DomainStatus::PENDING_DELETE_CONFIRMATION
|
||||
assert_epp_response :completed_successfully_action_pending
|
||||
end
|
||||
|
@ -62,7 +62,7 @@ class EppDomainDeleteBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_epp_response :object_status_prohibits_operation
|
||||
end
|
||||
|
@ -89,7 +89,7 @@ class EppDomainDeleteBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert @domain.registrant_verification_asked?
|
||||
|
@ -120,7 +120,7 @@ class EppDomainDeleteBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert_not @domain.registrant_verification_asked?
|
||||
|
@ -151,7 +151,7 @@ class EppDomainDeleteBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert_not @domain.registrant_verification_asked?
|
||||
|
@ -176,7 +176,7 @@ class EppDomainDeleteBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :required_parameter_missing
|
||||
end
|
||||
|
@ -203,7 +203,7 @@ class EppDomainDeleteBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :object_status_prohibits_operation
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -49,7 +49,7 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
||||
|
@ -76,7 +76,7 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_goodnames'
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_goodnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
||||
|
@ -99,7 +99,7 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_goodnames'
|
||||
post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_goodnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_nil response_xml.at_xpath('//domain:authInfo/domain:pw',
|
||||
|
|
|
@ -24,7 +24,7 @@ class EppDomainRenewBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
domain.reload
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -50,7 +50,7 @@ class EppDomainRenewBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_changes -> { domain.valid_to } do
|
||||
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
domain.reload
|
||||
end
|
||||
assert_epp_response :object_status_prohibits_operation
|
||||
|
@ -77,7 +77,7 @@ class EppDomainRenewBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_changes -> { domain.valid_to } do
|
||||
post '/epp/command/renew', { frame: request_xml },
|
||||
post epp_renew_path, { frame: request_xml },
|
||||
'HTTP_COOKIE' => "session=#{session.session_id}"
|
||||
domain.reload
|
||||
end
|
||||
|
@ -105,7 +105,7 @@ class EppDomainRenewBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_difference -> { domain.valid_to } do
|
||||
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' =>
|
||||
post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' =>
|
||||
"session=#{session.session_id}"
|
||||
domain.reload
|
||||
end
|
||||
|
@ -132,7 +132,7 @@ class EppDomainRenewBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_changes -> { domain.valid_to } do
|
||||
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
domain.reload
|
||||
end
|
||||
assert_epp_response :billing_failure
|
||||
|
@ -158,7 +158,7 @@ class EppDomainRenewBaseTest < EppTestCase
|
|||
XML
|
||||
|
||||
assert_no_changes -> { domain.valid_to } do
|
||||
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
domain.reload
|
||||
end
|
||||
assert_epp_response :parameter_value_policy_error
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'test_helper'
|
|||
|
||||
class EppDomainTransferQueryTest < EppTestCase
|
||||
def test_returns_domain_transfer_details
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
xml_doc = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
assert_equal 'shop.test', xml_doc.xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
||||
|
@ -28,14 +28,14 @@ class EppDomainTransferQueryTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_epp_response :invalid_authorization_information
|
||||
end
|
||||
|
||||
def test_no_domain_transfer
|
||||
domains(:shop).transfers.delete_all
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
assert_epp_response :object_does_not_exist
|
||||
end
|
||||
|
||||
|
|
|
@ -13,24 +13,24 @@ class EppDomainTransferRequestTest < EppTestCase
|
|||
end
|
||||
|
||||
def test_transfers_domain_at_once
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
||||
def test_creates_new_domain_transfer
|
||||
assert_difference -> { @domain.transfers.size } do
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
end
|
||||
end
|
||||
|
||||
def test_approves_automatically_if_auto_approval_is_enabled
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
assert_equal 'serverApproved', Nokogiri::XML(response.body).xpath('//domain:trStatus', 'domain' =>
|
||||
'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
||||
end
|
||||
|
||||
def test_assigns_new_registrar
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
@domain.reload
|
||||
assert_equal @new_registrar, @domain.registrar
|
||||
end
|
||||
|
@ -38,7 +38,7 @@ class EppDomainTransferRequestTest < EppTestCase
|
|||
def test_regenerates_transfer_code
|
||||
@old_transfer_code = @domain.transfer_code
|
||||
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
|
||||
@domain.reload
|
||||
refute_equal @domain.transfer_code, @old_transfer_code
|
||||
|
@ -48,31 +48,31 @@ class EppDomainTransferRequestTest < EppTestCase
|
|||
@old_registrar = @domain.registrar
|
||||
|
||||
assert_difference -> { @old_registrar.notifications.count } do
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
end
|
||||
end
|
||||
|
||||
def test_duplicates_registrant_admin_and_tech_contacts
|
||||
assert_difference -> { @new_registrar.contacts.size }, 3 do
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
end
|
||||
end
|
||||
|
||||
def test_reuses_identical_contact
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
assert_equal 1, @new_registrar.contacts.where(name: 'William').size
|
||||
end
|
||||
|
||||
def test_saves_legal_document
|
||||
assert_difference -> { @domain.legal_documents(true).size } do
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
end
|
||||
end
|
||||
|
||||
def test_non_transferable_domain
|
||||
@domain.update!(statuses: [DomainStatus::SERVER_TRANSFER_PROHIBITED])
|
||||
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
domains(:shop).reload
|
||||
|
||||
assert_equal registrars(:bestnames), domains(:shop).registrar
|
||||
|
@ -82,7 +82,7 @@ class EppDomainTransferRequestTest < EppTestCase
|
|||
def test_discarded_domain_cannot_be_transferred
|
||||
@domain.update!(statuses: [DomainStatus::DELETE_CANDIDATE])
|
||||
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
@domain.reload
|
||||
|
||||
assert_equal registrars(:bestnames), @domain.registrar
|
||||
|
@ -91,7 +91,7 @@ class EppDomainTransferRequestTest < EppTestCase
|
|||
|
||||
def test_same_registrar
|
||||
assert_no_difference -> { @domain.transfers.size } do
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
end
|
||||
assert_epp_response :use_error
|
||||
end
|
||||
|
@ -113,7 +113,7 @@ class EppDomainTransferRequestTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||
@domain.reload
|
||||
|
||||
assert_epp_response :invalid_authorization_information
|
||||
|
|
|
@ -34,7 +34,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
assert_equal 'f0ff7d17b0', @domain.transfer_code
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -56,7 +56,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
assert_epp_response :object_status_prohibits_operation
|
||||
end
|
||||
|
||||
|
@ -76,7 +76,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :object_status_prohibits_operation
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
|
@ -109,7 +109,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert_epp_response :completed_successfully_action_pending
|
||||
|
@ -145,7 +145,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert_epp_response :completed_successfully_action_pending
|
||||
|
@ -179,7 +179,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -214,7 +214,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -250,7 +250,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -287,7 +287,7 @@ class EppDomainUpdateBaseTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
@domain.reload
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
|
|
|
@ -9,7 +9,7 @@ class EppHelloTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
get '/epp/session/hello', { frame: request_xml }, 'HTTP_COOKIE' => 'session=non-existent'
|
||||
get epp_hello_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=non-existent'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal 'EPP server (EIS)', response_xml.at_css('greeting > svID').text
|
||||
|
|
|
@ -24,7 +24,7 @@ class EppLoginCredentialsTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
post epp_login_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
assert EppSession.find_by(session_id: 'new_session_id')
|
||||
assert_equal users(:api_bestnames), EppSession.find_by(session_id: 'new_session_id').user
|
||||
assert_epp_response :completed_successfully
|
||||
|
@ -57,7 +57,7 @@ class EppLoginCredentialsTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/session/login', { frame: request_xml }, 'HTTP_COOKIE' => 'session=any_random_string'
|
||||
post epp_login_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=any_random_string'
|
||||
|
||||
assert_epp_response :authentication_error_server_closing_connection
|
||||
end
|
||||
|
|
|
@ -25,7 +25,7 @@ class EppLoginPasswordChangeTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
post epp_login_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
assert_equal 'new-password', users(:api_bestnames).plain_text_password
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ class EppLoginSessionLimitTest < EppTestCase
|
|||
end
|
||||
|
||||
assert_difference 'EppSession.count' do
|
||||
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
post epp_login_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
end
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ class EppLoginSessionLimitTest < EppTestCase
|
|||
end
|
||||
|
||||
assert_no_difference 'EppSession.count' do
|
||||
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
post epp_login_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
end
|
||||
assert_epp_response :authentication_error_server_closing_connection
|
||||
end
|
||||
|
|
|
@ -2,22 +2,22 @@ require 'test_helper'
|
|||
|
||||
class EppLogoutTest < EppTestCase
|
||||
def test_success_response
|
||||
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
post epp_logout_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
assert_epp_response :completed_successfully_ending_session
|
||||
end
|
||||
|
||||
def test_ends_current_session
|
||||
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
post epp_logout_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
assert_nil EppSession.find_by(session_id: 'api_bestnames')
|
||||
end
|
||||
|
||||
def test_keeps_other_sessions_intact
|
||||
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
post epp_logout_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
assert EppSession.find_by(session_id: 'api_goodnames')
|
||||
end
|
||||
|
||||
def test_anonymous_user
|
||||
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=non-existent' }
|
||||
post epp_logout_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=non-existent' }
|
||||
assert_epp_response :authorization_error
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class EppPollTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
xml_doc = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully_ack_to_dequeue
|
||||
|
@ -36,7 +36,7 @@ class EppPollTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
xml_doc = Nokogiri::XML(response.body)
|
||||
namespace = 'https://epp.tld.ee/schema/changePoll-1.0.xsd'
|
||||
|
@ -60,7 +60,7 @@ class EppPollTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :completed_successfully_no_messages
|
||||
end
|
||||
|
@ -77,7 +77,7 @@ class EppPollTest < EppTestCase
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
notification.reload
|
||||
|
||||
xml_doc = Nokogiri::XML(response.body)
|
||||
|
@ -98,7 +98,7 @@ class EppPollTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
notification.reload
|
||||
|
||||
assert notification.unread?
|
||||
|
@ -114,7 +114,7 @@ class EppPollTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :object_does_not_exist
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue