diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index fb01fe38a..249f90a98 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -18,7 +18,7 @@ class Epp::Domain < Domain after_validation :validate_contacts def validate_contacts - return true if is_renewal || is_transfer + return true if is_transfer ok = true active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? } diff --git a/test/integration/epp/domain/domain_renew_test.rb b/test/integration/epp/domain/domain_renew_test.rb new file mode 100644 index 000000000..a60ec6843 --- /dev/null +++ b/test/integration/epp/domain/domain_renew_test.rb @@ -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 + + + + + + invalid.test + 2010-07-05 + 1 + + + + + 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