Introduce custom assertion

This commit is contained in:
Artur Beljajev 2019-09-03 18:15:58 +03:00
parent 5939da366e
commit 348e6e5d7a
54 changed files with 378 additions and 389 deletions

View file

@ -1,6 +1,6 @@
require 'test_helper'
class EppLoginSessionLimitTest < ApplicationIntegrationTest
class EppLoginSessionLimitTest < EppTestCase
setup do
travel_to Time.zone.parse('2010-07-05')
EppSession.delete_all
@ -16,9 +16,7 @@ class EppLoginSessionLimitTest < ApplicationIntegrationTest
assert_difference 'EppSession.count' do
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
end
assert Nokogiri::XML(response.body).at_css('result[code="1000"]')
assert_equal 1, Nokogiri::XML(response.body).css('result').size
assert_epp_response :completed_successfully
end
def test_reached
@ -31,8 +29,7 @@ class EppLoginSessionLimitTest < ApplicationIntegrationTest
assert_no_difference 'EppSession.count' do
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
end
assert Nokogiri::XML(response.body).at_css('result[code="2501"]')
assert_epp_response :authentication_error_server_closing_connection
end
private