From ec97e45921afbcdf86ca414fd5ebb854f90da1e5 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 26 May 2021 12:04:55 +0300 Subject: [PATCH] added test --- lib/schemas/all-ee-1.1.xsd | 2 +- lib/schemas/domain-eis-1.1.xsd | 2 +- test/integration/epp/domain/info/base_test.rb | 32 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/schemas/all-ee-1.1.xsd b/lib/schemas/all-ee-1.1.xsd index 96d4f5031..70397d753 100644 --- a/lib/schemas/all-ee-1.1.xsd +++ b/lib/schemas/all-ee-1.1.xsd @@ -31,7 +31,7 @@ + schemaLocation="lib/schemas/domain-eis-1.1.xsd"/> diff --git a/lib/schemas/domain-eis-1.1.xsd b/lib/schemas/domain-eis-1.1.xsd index 8b22f3c3f..2b9959053 100644 --- a/lib/schemas/domain-eis-1.1.xsd +++ b/lib/schemas/domain-eis-1.1.xsd @@ -1,4 +1,4 @@ - + 'session=api_bestnames' } response_xml = Nokogiri::XML(response.body) + p response_xml assert_epp_response :completed_successfully assert_equal 'shop.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal 'ok', response_xml.at_xpath('//domain:status', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['s'] @@ -71,6 +72,37 @@ class EppDomainInfoBaseTest < EppTestCase assert_equal 0, schema_validation_errors.size end + def test_returns_valid_response_if_release_prohibited + domain = domains(:shop) + domain.update_columns(statuses: [DomainStatus::SERVER_RELEASE_PROHIBITED], + created_at: Time.now - 5.days, + creator_str: 'test', + delete_date: Time.now - 1.day) + + request_xml = <<-XML + + + + + + shop.test + + + + + XML + + post epp_info_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + + response_xml = Nokogiri::XML(response.body) + assert_epp_response :completed_successfully + schema = EPP_ALL_SCHEMA + + schema_validation_errors = schema.validate(response_xml) + assert_equal 0, schema_validation_errors.size + end + def test_reveals_transfer_code_when_domain_is_owned_by_current_user assert_equal '65078d5', domains(:shop).transfer_code