mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 15:14:47 +02:00
Add test to check if serverUpdateProhibited is kept on epp
This commit is contained in:
parent
134ace00ed
commit
19697eba34
1 changed files with 32 additions and 0 deletions
|
@ -32,6 +32,38 @@ class EppDomainRenewBaseTest < EppTestCase
|
||||||
assert_equal original_valid_to + default_renewal_period, domain.valid_to
|
assert_equal original_valid_to + default_renewal_period, domain.valid_to
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_renews_domain_if_update_prohibited
|
||||||
|
travel_to Time.zone.parse('2010-07-05')
|
||||||
|
domain = domains(:shop)
|
||||||
|
original_valid_to = domain.valid_to
|
||||||
|
default_renewal_period = 1.year
|
||||||
|
domain.statuses << DomainStatus::SERVER_UPDATE_PROHIBITED
|
||||||
|
domain.save
|
||||||
|
|
||||||
|
request_xml = <<-XML
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||||
|
<command>
|
||||||
|
<renew>
|
||||||
|
<domain:renew xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||||
|
<domain:name>#{domain.name}</domain:name>
|
||||||
|
<domain:curExpDate>#{domain.expire_time.to_date}</domain:curExpDate>
|
||||||
|
<domain:period unit="y">1</domain:period>
|
||||||
|
</domain:renew>
|
||||||
|
</renew>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
|
||||||
|
post epp_renew_path, params: { frame: request_xml },
|
||||||
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
domain.reload
|
||||||
|
|
||||||
|
assert_epp_response :completed_successfully
|
||||||
|
assert_equal original_valid_to + default_renewal_period, domain.valid_to
|
||||||
|
assert domain.statuses.include? DomainStatus::SERVER_UPDATE_PROHIBITED
|
||||||
|
end
|
||||||
|
|
||||||
def test_domain_cannot_be_renewed_when_invalid
|
def test_domain_cannot_be_renewed_when_invalid
|
||||||
domain = domains(:invalid)
|
domain = domains(:invalid)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue