mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 21:54:48 +02:00
parent
139b7f290d
commit
29a8f39cb6
2 changed files with 33 additions and 1 deletions
|
@ -18,7 +18,7 @@ class Epp::Domain < Domain
|
||||||
|
|
||||||
after_validation :validate_contacts
|
after_validation :validate_contacts
|
||||||
def validate_contacts
|
def validate_contacts
|
||||||
return true if is_renewal || is_transfer
|
return true if is_transfer
|
||||||
|
|
||||||
ok = true
|
ok = true
|
||||||
active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? }
|
active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? }
|
||||||
|
|
32
test/integration/epp/domain/domain_renew_test.rb
Normal file
32
test/integration/epp/domain/domain_renew_test.rb
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class EppDomainRenewTest < ActionDispatch::IntegrationTest
|
||||||
|
self.use_transactional_fixtures = false
|
||||||
|
|
||||||
|
def setup
|
||||||
|
travel_to Time.zone.parse('2010-07-05')
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_domain_cannot_be_renewed_when_invalid
|
||||||
|
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>invalid.test</domain:name>
|
||||||
|
<domain:curExpDate>2010-07-05</domain:curExpDate>
|
||||||
|
<domain:period unit="m">1</domain:period>
|
||||||
|
</domain:renew>
|
||||||
|
</renew>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
|
||||||
|
assert_no_changes -> { domains(:invalid).valid_to } do
|
||||||
|
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||||
|
end
|
||||||
|
assert_equal '2304', Nokogiri::XML(response.body).at_css('result')[:code],
|
||||||
|
Nokogiri::XML(response.body).css('result').text
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue