mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Use new requires_attribute method in poll
This commit is contained in:
parent
857ab488b8
commit
365e27086f
5 changed files with 5 additions and 10 deletions
|
@ -38,9 +38,6 @@ class Epp::PollsController < EppController
|
|||
private
|
||||
|
||||
def validate_poll
|
||||
op = params[:parsed_frame].css('poll').first[:op]
|
||||
return true if %w(ack req).include?(op)
|
||||
epp_errors << { code: '2306', msg: I18n.t('errors.messages.attribute_op_is_invalid') }
|
||||
false
|
||||
requires_attribute 'poll', 'op', values: %(ack req)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -79,7 +79,7 @@ class EppController < ApplicationController
|
|||
full_selector = [@prefix, selector].join(' ')
|
||||
el = params[:parsed_frame].css(full_selector).first
|
||||
|
||||
missing = el.nil? || (el.text.blank? && el.children.none?)
|
||||
missing = el.nil?
|
||||
|
||||
epp_errors << {
|
||||
code: '2003',
|
||||
|
|
|
@ -213,7 +213,7 @@ describe 'EPP Domain', epp: true do
|
|||
xml = domain_create_xml(ns: [])
|
||||
response = epp_plain_request(xml, :xml)
|
||||
response[:result_code].should == '2003'
|
||||
response[:msg].should == 'Required parameter missing: ns'
|
||||
response[:msg].should == 'Required parameter missing: ns > hostAttr'
|
||||
end
|
||||
|
||||
it 'does not create domain with too many nameservers' do
|
||||
|
|
|
@ -75,7 +75,6 @@ describe 'EPP Keyrelay', epp: true do
|
|||
xml = epp_xml.keyrelay({
|
||||
name: { value: domain.name },
|
||||
keyData: {
|
||||
flags: { value: '' },
|
||||
protocol: { value: '3' },
|
||||
alg: { value: '8' },
|
||||
pubKey: { value: 'cmlraXN0aGViZXN0' }
|
||||
|
@ -89,7 +88,7 @@ describe 'EPP Keyrelay', epp: true do
|
|||
})
|
||||
|
||||
response = epp_request(xml, :xml, :elkdata)
|
||||
response[:msg].should == 'Required parameter missing: flags'
|
||||
response[:msg].should == 'Required parameter missing: keyData > flags'
|
||||
|
||||
@zone.messages.queued.count.should == msg_count
|
||||
end
|
||||
|
|
|
@ -25,7 +25,6 @@ describe 'EPP Poll', epp: true do
|
|||
it 'returns no messages in poll' do
|
||||
ApiLog::EppLog.delete_all
|
||||
response = epp_plain_request(epp_xml.poll, :xml)
|
||||
|
||||
response[:msg].should == 'Command completed successfully; no messages'
|
||||
response[:result_code].should == '1300'
|
||||
|
||||
|
@ -89,7 +88,7 @@ describe 'EPP Poll', epp: true do
|
|||
})
|
||||
|
||||
response = epp_plain_request(xml, :xml)
|
||||
response[:msg].should == 'Attribute op is invalid'
|
||||
response[:msg].should == 'Attribute is invalid: op'
|
||||
end
|
||||
|
||||
it 'dequeues multiple messages' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue