Merge branch 'master' into refactor-messages

# Conflicts:
#	app/views/epp/poll/poll_req.xml.builder
#	test/fixtures/messages.yml
#	test/integration/epp/poll_test.rb
This commit is contained in:
Artur Beljajev 2018-09-17 13:21:33 +03:00
commit 1679e4b72e
8 changed files with 55 additions and 7 deletions

View file

@ -7,7 +7,7 @@ domain_deleted:
text: Your domain has been deleted
read: false
registrar: bestnames
created_at: <%= Time.zone.parse('2010-07-05').to_s(:db) %>
created_at: <%= Time.zone.parse('2010-07-05') %>
farewell:
text: Good bye!

View file

@ -1,10 +1,29 @@
require 'test_helper'
class EppPollTest < ApplicationIntegrationTest
# Deliberately does not conform to RFC5730, which requires the first message to be returned
# Deliberately does not conform to RFC5730, which requires the first notification to be returned
def test_return_latest_notification_when_queue_is_not_empty
notification = notifications(:domain_deleted)
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
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body)
assert_equal 1301.to_s, response_xml.at_css('result')[:code]
assert_equal 1, response_xml.css('result').size
assert_equal 2.to_s, response_xml.at_css('msgQ')[:count]
assert_equal notification.id.to_s, response_xml.at_css('msgQ')[:id]
assert_equal Time.zone.parse('2010-07-05').utc.xmlschema, response_xml.at_css('msgQ qDate').text
assert_equal 'Your domain has been deleted', response_xml.at_css('msgQ msg').text
end
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">

View file

@ -22,7 +22,6 @@ class WhoisRecordTest < ActiveSupport::TestCase
registrant_kind: 'priv',
email: 'john@inbox.test',
expire: '2010-07-05',
nameservers: ['ns1.bestnames.test', 'ns2.bestnames.test'],
registrar_address: 'Main Street, New York, New York, 12345',
dnssec_keys: [],
}
@ -30,6 +29,10 @@ class WhoisRecordTest < ActiveSupport::TestCase
expected_partial_hash.each do |key, value|
assert_equal(value, @record.generated_json[key])
end
['ns1.bestnames.test', 'ns2.bestnames.test'].each do |item|
assert(@record.generated_json[:nameservers].include?(item))
end
end
def test_generated_body_has_justified_disclaimer