diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 618c23521..ba6195710 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -802,11 +802,6 @@ class Epp::Domain < Domain next end - if ReservedDomain.pw_for(domain_name_as_string).present? - result << { name: domain_name_as_string, avail: 0, reason: I18n.t('errors.messages.epp_domain_reserved') } - next - end - domain_name = DNS::DomainName.new(domain_name_as_string) if domain_name.unavailable? diff --git a/config/locales/en.yml b/config/locales/en.yml index ab35222e7..cdc78101f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -196,7 +196,6 @@ en: errors: messages: blank: 'is missing' - epp_domain_reserved: 'Domain name is reserved' epp_domain_blocked: Blocked epp_obj_does_not_exist: 'Object does not exist' epp_authorization_error: 'Authorization error' diff --git a/test/integration/epp/domain/check/base_test.rb b/test/integration/epp/domain/check/base_test.rb index 2c1b0ca66..8185ef5fd 100644 --- a/test/integration/epp/domain/check/base_test.rb +++ b/test/integration/epp/domain/check/base_test.rb @@ -23,7 +23,7 @@ class EppDomainCheckBaseTest < ApplicationIntegrationTest assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text end - def test_domain_is_available_when_not_registered_blocked_nor_reserved + def test_domain_is_available_when_not_registered_or_blocked request_xml = <<-XML @@ -44,6 +44,29 @@ class EppDomainCheckBaseTest < ApplicationIntegrationTest assert_nil response_xml.at_xpath('//domain:reason', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') end + def test_domain_is_available_when_reserved + assert_equal 'reserved.test', reserved_domains(:one).name + + request_xml = <<-XML + + + + + + reserved.test + + + + + XML + + post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' + + response_xml = Nokogiri::XML(response.body) + assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail'] + assert_nil response_xml.at_xpath('//domain:reason', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') + end + def test_domain_is_unavailable_when_format_is_invalid request_xml = <<-XML @@ -111,29 +134,6 @@ class EppDomainCheckBaseTest < ApplicationIntegrationTest assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text end - def test_domain_is_unavailable_when_reserved - assert_equal 'reserved.test', reserved_domains(:one).name - - request_xml = <<-XML - - - - - - reserved.test - - - - - XML - - post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' - - response_xml = Nokogiri::XML(response.body) - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail'] - assert_equal 'Domain name is reserved', response_xml.at_xpath('//domain:reason', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text - end - def test_multiple_domains request_xml = <<-XML