From da07639457f5cfdd98e393d94bb3c1a153ad7337 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Thu, 25 Jan 2018 14:34:17 +0200 Subject: [PATCH] Update EPP domain tests #660 --- .../epp/{ => domain}/domain_transfer_test.rb | 8 +++-- .../epp/domain/domain_update_test.rb | 32 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) rename test/integration/epp/{ => domain}/domain_transfer_test.rb (85%) create mode 100644 test/integration/epp/domain/domain_update_test.rb diff --git a/test/integration/epp/domain_transfer_test.rb b/test/integration/epp/domain/domain_transfer_test.rb similarity index 85% rename from test/integration/epp/domain_transfer_test.rb rename to test/integration/epp/domain/domain_transfer_test.rb index 2bf733bd1..e50685aa8 100644 --- a/test/integration/epp/domain_transfer_test.rb +++ b/test/integration/epp/domain/domain_transfer_test.rb @@ -1,6 +1,10 @@ require 'test_helper' -class Epp::DomainTransferTest < ActionDispatch::IntegrationTest +class EppDomainTransferTest < ActionDispatch::IntegrationTest + def setup + login_as users(:api_goodnames) + end + def test_transfers_domain request_xml = <<-XML @@ -20,7 +24,7 @@ class Epp::DomainTransferTest < ActionDispatch::IntegrationTest session_id = epp_sessions(:api_goodnames).session_id post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => "session=#{session_id}" } - assert_response :ok + assert_response 200 assert_equal registrars(:goodnames), domains(:shop).registrar end end diff --git a/test/integration/epp/domain/domain_update_test.rb b/test/integration/epp/domain/domain_update_test.rb new file mode 100644 index 000000000..7302f8cd6 --- /dev/null +++ b/test/integration/epp/domain/domain_update_test.rb @@ -0,0 +1,32 @@ +require 'test_helper' + +class EppDomainUpdateTest < ActionDispatch::IntegrationTest + def setup + login_as users(:api_bestnames) + end + + def test_updates_transfer_code + request_xml = <<-XML + + + + + + shop.test + + + f0ff7d17b0 + + + + + + + XML + + session_id = epp_sessions(:api_bestnames).session_id + post '/epp/command/update', { frame: request_xml }, { 'HTTP_COOKIE' => "session=#{session_id}" } + assert_response 200 + assert_equal 'f0ff7d17b0', domains(:shop).transfer_code + end +end