mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
parent
07e40d61dd
commit
34f1e2be2f
2 changed files with 13 additions and 0 deletions
|
@ -3,6 +3,7 @@ require 'test_helper'
|
||||||
class APIDomainTransfersTest < ActionDispatch::IntegrationTest
|
class APIDomainTransfersTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
def setup
|
||||||
@domain = domains(:shop)
|
@domain = domains(:shop)
|
||||||
|
Setting.transfer_wait_time = 0 # Auto-approval
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_returns_domain_transfers
|
def test_returns_domain_transfers
|
||||||
|
@ -14,6 +15,12 @@ class APIDomainTransfersTest < ActionDispatch::IntegrationTest
|
||||||
JSON.parse(response.body, symbolize_names: true)
|
JSON.parse(response.body, symbolize_names: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_creates_new_domain_transfer
|
||||||
|
assert_difference -> { @domain.domain_transfers.size } do
|
||||||
|
post '/repp/v1/domain_transfers', request_params, { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_approves_automatically_if_auto_approval_is_enabled
|
def test_approves_automatically_if_auto_approval_is_enabled
|
||||||
post '/repp/v1/domain_transfers', request_params, { 'HTTP_AUTHORIZATION' => http_auth_key }
|
post '/repp/v1/domain_transfers', request_params, { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||||
assert @domain.domain_transfers(true).last.approved?
|
assert @domain.domain_transfers(true).last.approved?
|
||||||
|
|
|
@ -12,6 +12,12 @@ class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
|
||||||
assert_equal 1, Nokogiri::XML(response.body).css('result').size
|
assert_equal 1, Nokogiri::XML(response.body).css('result').size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_creates_new_domain_transfer
|
||||||
|
assert_difference -> { @domain.domain_transfers.size } do
|
||||||
|
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_approves_automatically_if_auto_approval_is_enabled
|
def test_approves_automatically_if_auto_approval_is_enabled
|
||||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
|
||||||
assert_equal 'serverApproved', Nokogiri::XML(response.body).xpath('//domain:trStatus', 'domain' =>
|
assert_equal 'serverApproved', Nokogiri::XML(response.body).xpath('//domain:trStatus', 'domain' =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue