mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 07:34:45 +02:00
parent
7fb7a4f657
commit
223b4f4815
2 changed files with 34 additions and 0 deletions
4
test/fixtures/messages.yml
vendored
Normal file
4
test/fixtures/messages.yml
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
greeting:
|
||||||
|
body: Welcome!
|
||||||
|
queued: true
|
||||||
|
registrar: bestnames
|
30
test/integration/epp/poll_test.rb
Normal file
30
test/integration/epp/poll_test.rb
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class EppPollTest < ActionDispatch::IntegrationTest
|
||||||
|
def test_messages
|
||||||
|
post '/epp/command/poll', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
assert_equal '1301', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||||
|
assert_equal 1, Nokogiri::XML(response.body).css('msgQ').size
|
||||||
|
assert_equal 1, Nokogiri::XML(response.body).css('result').size
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_no_messages
|
||||||
|
registrars(:bestnames).messages.delete_all(:delete_all)
|
||||||
|
post '/epp/command/poll', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
assert_equal '1300', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||||
|
assert_equal 1, Nokogiri::XML(response.body).css('result').size
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def request_xml
|
||||||
|
<<-XML
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||||
|
<command>
|
||||||
|
<poll op="req"/>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue