Delete discarded domains at the random moment within next 24h

#790
This commit is contained in:
Artur Beljajev 2018-04-20 16:55:36 +03:00
parent 60a66942d1
commit 3e94c10da1
8 changed files with 105 additions and 31 deletions

View file

@ -1,12 +1,17 @@
require 'test_helper'
class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
setup do
def setup
@domain = domains(:shop)
@new_registrar = registrars(:goodnames)
@original_transfer_wait_time = Setting.transfer_wait_time
Setting.transfer_wait_time = 0
end
def teardown
Setting.transfer_wait_time = @original_transfer_wait_time
end
def test_transfers_domain_at_once
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
assert_equal '1000', Nokogiri::XML(response.body).at_css('result')[:code]
@ -76,6 +81,8 @@ class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
end
def test_discarded_domain_cannot_be_transferred
travel_to Time.zone.parse('2010-07-05 10:30')
@domain.delete_at = Time.zone.parse('2010-07-05 10:00')
@domain.discard
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
@ -83,6 +90,7 @@ class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
assert_equal registrars(:bestnames), @domain.registrar
assert_equal '2105', Nokogiri::XML(response.body).at_css('result')[:code]
travel_back
end
def test_same_registrar