diff --git a/config/routes.rb b/config/routes.rb index 4c1e25864..4dfa7cc86 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/test/integration/epp/base_test.rb b/test/integration/epp/base_test.rb index a07ab767c..6d8531870 100644 --- a/test/integration/epp/base_test.rb +++ b/test/integration/epp/base_test.rb @@ -50,7 +50,7 @@ class EppBaseTest < EppTestCase 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 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 diff --git a/test/integration/epp/contact/base_test.rb b/test/integration/epp/contact/base_test.rb index c332e7b36..ef10fdb35 100644 --- a/test/integration/epp/contact/base_test.rb +++ b/test/integration/epp/contact/base_test.rb @@ -14,7 +14,7 @@ class EppContactBaseTest < EppTestCase 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 diff --git a/test/integration/epp/contact/check/base_test.rb b/test/integration/epp/contact/check/base_test.rb index 03fa7aba8..4e630c94c 100644 --- a/test/integration/epp/contact/check/base_test.rb +++ b/test/integration/epp/contact/check/base_test.rb @@ -21,7 +21,7 @@ class EppContactCheckBaseTest < EppTestCase 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 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 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 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 diff --git a/test/integration/epp/contact/create/base_test.rb b/test/integration/epp/contact/create/base_test.rb index 68b30371a..1f749123c 100644 --- a/test/integration/epp/contact/create/base_test.rb +++ b/test/integration/epp/contact/create/base_test.rb @@ -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 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 diff --git a/test/integration/epp/contact/delete/base_test.rb b/test/integration/epp/contact/delete/base_test.rb index 442d16a63..d8ce06c95 100644 --- a/test/integration/epp/contact/delete/base_test.rb +++ b/test/integration/epp/contact/delete/base_test.rb @@ -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 diff --git a/test/integration/epp/contact/info/base_test.rb b/test/integration/epp/contact/info/base_test.rb index d535d14d5..6bfcc896d 100644 --- a/test/integration/epp/contact/info/base_test.rb +++ b/test/integration/epp/contact/info/base_test.rb @@ -29,7 +29,7 @@ class EppContactInfoBaseTest < EppTestCase 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 diff --git a/test/integration/epp/contact/update/base_test.rb b/test/integration/epp/contact/update/base_test.rb index 7f76a310f..ad5e58862 100644 --- a/test/integration/epp/contact/update/base_test.rb +++ b/test/integration/epp/contact/update/base_test.rb @@ -37,7 +37,7 @@ class EppContactUpdateBaseTest < EppTestCase 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 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 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 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 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 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 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 diff --git a/test/integration/epp/domain/base_test.rb b/test/integration/epp/domain/base_test.rb index b12fcf8da..125e173a7 100644 --- a/test/integration/epp/domain/base_test.rb +++ b/test/integration/epp/domain/base_test.rb @@ -14,7 +14,7 @@ class EppDomainBaseTest < EppTestCase 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 diff --git a/test/integration/epp/domain/check/auction_test.rb b/test/integration/epp/domain/check/auction_test.rb index d52a65629..7b4dcb595 100644 --- a/test/integration/epp/domain/check/auction_test.rb +++ b/test/integration/epp/domain/check/auction_test.rb @@ -28,7 +28,7 @@ class EppDomainCheckAuctionTest < EppTestCase 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 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 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 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 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 diff --git a/test/integration/epp/domain/check/base_test.rb b/test/integration/epp/domain/check/base_test.rb index fc8eaaca0..bed7a5b2f 100644 --- a/test/integration/epp/domain/check/base_test.rb +++ b/test/integration/epp/domain/check/base_test.rb @@ -15,7 +15,7 @@ class EppDomainCheckBaseTest < EppTestCase 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 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 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 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 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 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 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 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 diff --git a/test/integration/epp/domain/create/auction_idn_test.rb b/test/integration/epp/domain/create/auction_idn_test.rb index d4c49d66d..c5e9f840c 100644 --- a/test/integration/epp/domain/create/auction_idn_test.rb +++ b/test/integration/epp/domain/create/auction_idn_test.rb @@ -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 diff --git a/test/integration/epp/domain/create/auction_test.rb b/test/integration/epp/domain/create/auction_test.rb index 73104c0bb..863f473a7 100644 --- a/test/integration/epp/domain/create/auction_test.rb +++ b/test/integration/epp/domain/create/auction_test.rb @@ -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 diff --git a/test/integration/epp/domain/create/base_test.rb b/test/integration/epp/domain/create/base_test.rb index 43db1e53e..a5c1dac93 100644 --- a/test/integration/epp/domain/create/base_test.rb +++ b/test/integration/epp/domain/create/base_test.rb @@ -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 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 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 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 diff --git a/test/integration/epp/domain/delete/base_test.rb b/test/integration/epp/domain/delete/base_test.rb index 2ee71fcc2..0a70afe2e 100644 --- a/test/integration/epp/domain/delete/base_test.rb +++ b/test/integration/epp/domain/delete/base_test.rb @@ -34,7 +34,7 @@ class EppDomainDeleteBaseTest < EppTestCase 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 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 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 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 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 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 diff --git a/test/integration/epp/domain/info/base_test.rb b/test/integration/epp/domain/info/base_test.rb index fd90177ca..041c39cf3 100644 --- a/test/integration/epp/domain/info/base_test.rb +++ b/test/integration/epp/domain/info/base_test.rb @@ -21,7 +21,7 @@ class EppDomainInfoBaseTest < EppTestCase 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 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 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 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', diff --git a/test/integration/epp/domain/renew/base_test.rb b/test/integration/epp/domain/renew/base_test.rb index 537e697c9..6c11f826e 100644 --- a/test/integration/epp/domain/renew/base_test.rb +++ b/test/integration/epp/domain/renew/base_test.rb @@ -24,7 +24,7 @@ class EppDomainRenewBaseTest < EppTestCase 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 diff --git a/test/integration/epp/domain/transfer/query_test.rb b/test/integration/epp/domain/transfer/query_test.rb index bd1293771..11e59d5ba 100644 --- a/test/integration/epp/domain/transfer/query_test.rb +++ b/test/integration/epp/domain/transfer/query_test.rb @@ -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 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 diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 6a1b5a9f1..caa068999 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -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 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 diff --git a/test/integration/epp/domain/update/base_test.rb b/test/integration/epp/domain/update/base_test.rb index e68a62306..29fc1b875 100644 --- a/test/integration/epp/domain/update/base_test.rb +++ b/test/integration/epp/domain/update/base_test.rb @@ -34,7 +34,7 @@ class EppDomainUpdateBaseTest < EppTestCase 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 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 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 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 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 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 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 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 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 diff --git a/test/integration/epp/hello_test.rb b/test/integration/epp/hello_test.rb index 1ccb65ff0..c7d5356c2 100644 --- a/test/integration/epp/hello_test.rb +++ b/test/integration/epp/hello_test.rb @@ -9,7 +9,7 @@ class EppHelloTest < EppTestCase 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 diff --git a/test/integration/epp/login/credentials_test.rb b/test/integration/epp/login/credentials_test.rb index a9275e8e8..8ce6adcf2 100644 --- a/test/integration/epp/login/credentials_test.rb +++ b/test/integration/epp/login/credentials_test.rb @@ -24,7 +24,7 @@ class EppLoginCredentialsTest < EppTestCase 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 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 diff --git a/test/integration/epp/login/password_change_test.rb b/test/integration/epp/login/password_change_test.rb index 69cda0d6a..5e557be81 100644 --- a/test/integration/epp/login/password_change_test.rb +++ b/test/integration/epp/login/password_change_test.rb @@ -25,7 +25,7 @@ class EppLoginPasswordChangeTest < EppTestCase 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 diff --git a/test/integration/epp/login/session_limit_test.rb b/test/integration/epp/login/session_limit_test.rb index a3db4f145..79c0a8384 100644 --- a/test/integration/epp/login/session_limit_test.rb +++ b/test/integration/epp/login/session_limit_test.rb @@ -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 diff --git a/test/integration/epp/logout_test.rb b/test/integration/epp/logout_test.rb index bb6340c13..a578246ae 100644 --- a/test/integration/epp/logout_test.rb +++ b/test/integration/epp/logout_test.rb @@ -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 diff --git a/test/integration/epp/poll_test.rb b/test/integration/epp/poll_test.rb index ae31398f1..5ccd4258a 100644 --- a/test/integration/epp/poll_test.rb +++ b/test/integration/epp/poll_test.rb @@ -15,7 +15,7 @@ class EppPollTest < EppTestCase 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 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 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 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 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 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