From d79d1fbeb1eb3a8ae6aff63c9352b69ed2576c2b Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 21 Jun 2021 13:50:45 +0300 Subject: [PATCH] fixed dnskey invalid alg response --- app/models/dnskey.rb | 2 +- .../epp/domain/update/base_test.rb | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/models/dnskey.rb b/app/models/dnskey.rb index e9e15802f..6742696b2 100644 --- a/app/models/dnskey.rb +++ b/app/models/dnskey.rb @@ -60,7 +60,7 @@ class Dnskey < ApplicationRecord def validate_algorithm return if alg.blank? return if ALGORITHMS.include?(alg.to_s) - errors.add(:alg, :invalid, values: "Valid algorithms are: #{ALGORITHMS.join(', ')}") + errors.add(:alg, :invalid, values: "#{ALGORITHMS.join(', ')}") end def validate_protocol diff --git a/test/integration/epp/domain/update/base_test.rb b/test/integration/epp/domain/update/base_test.rb index 0fb0a5fff..54f817c94 100644 --- a/test/integration/epp/domain/update/base_test.rb +++ b/test/integration/epp/domain/update/base_test.rb @@ -17,6 +17,37 @@ class EppDomainUpdateBaseTest < EppTestCase @original_registrant_change_verification end + def test_update_dnskey_with_invalid_alg + request_xml = <<~XML + + + + + + shop.test + + + + + + 257 + 3 + 666 + P25MwGXr2sTbxdOIKRNbSC8bUO2CObo4/T8kMFoKcgs= + + + + + + XML + + post epp_update_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + response_xml = Nokogiri::XML(response.body) + assert_correct_against_schema response_xml + assert_epp_response :parameter_value_syntax_error + end + def test_update_domain request_xml = <<-XML