Improve test

#694
This commit is contained in:
Artur Beljajev 2018-02-17 02:48:45 +02:00
parent 59ceb9c51a
commit 443485d5d6
4 changed files with 8 additions and 2 deletions

View file

@ -28,6 +28,8 @@ class EppDomainCreateTransferCodeTest < ActionDispatch::IntegrationTest
post '/epp/command/create', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post '/epp/command/create', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
refute_empty Domain.find_by(name: 'brandnew.test').transfer_code refute_empty Domain.find_by(name: 'brandnew.test').transfer_code
assert_equal '1000', Nokogiri::XML(response.body).at_css('result')[:code]
assert_equal 1, Nokogiri::XML(response.body).css('result').size
end end
def test_honors_custom def test_honors_custom
@ -56,5 +58,7 @@ class EppDomainCreateTransferCodeTest < ActionDispatch::IntegrationTest
post '/epp/command/create', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post '/epp/command/create', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_equal '1058ad73', Domain.find_by(name: 'brandnew.test').transfer_code assert_equal '1058ad73', Domain.find_by(name: 'brandnew.test').transfer_code
assert_equal '1000', Nokogiri::XML(response.body).at_css('result')[:code]
assert_equal 1, Nokogiri::XML(response.body).css('result').size
end end
end end

View file

@ -44,6 +44,6 @@ class EppDomainTransferTest < ActionDispatch::IntegrationTest
XML XML
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
assert Nokogiri::XML(response.body).at_css('result[code="2303"]') assert_equal '2303', Nokogiri::XML(response.body).at_css('result')[:code]
end end
end end

View file

@ -20,6 +20,6 @@ class EppDomainTransferTransferCodeTest < ActionDispatch::IntegrationTest
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
refute_equal registrars(:goodnames), domains(:shop).registrar refute_equal registrars(:goodnames), domains(:shop).registrar
assert Nokogiri::XML(response.body).at_css('result[code="2201"]') assert_equal '2201', Nokogiri::XML(response.body).at_css('result')[:code]
end end
end end

View file

@ -22,5 +22,7 @@ class EppDomainUpdateTest < ActionDispatch::IntegrationTest
post '/epp/command/update', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post '/epp/command/update', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_equal 'f0ff7d17b0', domains(:shop).transfer_code assert_equal 'f0ff7d17b0', domains(:shop).transfer_code
assert_equal '1000', Nokogiri::XML(response.body).at_css('result')[:code]
assert_equal 1, Nokogiri::XML(response.body).css('result').size
end end
end end