Disallow EPP domain:update/transfer/delete if a domain has "deleteCandidate" status

#355
This commit is contained in:
Artur Beljajev 2017-01-30 14:04:56 +02:00
parent f26783d340
commit 7d1a5558b0
12 changed files with 225 additions and 0 deletions

View file

@ -0,0 +1,35 @@
module Matchers
module EPP
class Code
def initialize(expected)
@expected = expected
end
def matches?(response)
@xml = response.body
actual == expected
end
def failure_message
"Expected EPP code of #{expected}, got #{actual} (#{description})"
end
private
attr_reader :xml
attr_reader :expected
def actual
xml_document.xpath('//xmlns:result').first['code'].to_i
end
def description
xml_document.css('result msg').text
end
def xml_document
@xml_document ||= Nokogiri::XML(xml)
end
end
end
end