mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Disallow EPP domain:update/transfer/delete if a domain has "deleteCandidate" status
#355
This commit is contained in:
parent
f26783d340
commit
7d1a5558b0
12 changed files with 225 additions and 0 deletions
35
spec/support/matchers/epp/code.rb
Normal file
35
spec/support/matchers/epp/code.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue