Sha256: 9e528d781baa46f7935480747ffbd0a447e098df9c1b2509968ef7d2db2bab36

Contents?: true

Size: 874 Bytes

Versions: 23

Compression:

Stored size: 874 Bytes

Contents

require 'test_helper'

class ErrorTest < Minitest::Test
  def error_response
    Gillbus::SessionLogin::Response.parse_string(File.read('test/responses/error.xml'))
  end

  def malformed_response
    Gillbus::SessionLogin::Response.parse_string('not an xml')
  end

  def malformed_response_2
    Gillbus::SessionLogin::Response.parse_string('<NOTDATA></NOTDATA>')
  end

  def test_errorness
    assert error_response.error?
    assert_equal 4, error_response.error_code
    assert_equal 'Session not created error!', error_response.error_message
    assert_equal "We'r fucked", error_response.external_error_message
  end

  def test_malformed_errorness
    assert malformed_response.error?
    assert malformed_response.error_message.include?("Malformed response: invalid format")
  end

  def test_malformed_2_errorness
    assert malformed_response_2.error?
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
gillbus-0.23.0 test/error_test.rb
gillbus-0.22.9 test/error_test.rb
gillbus-0.22.8 test/error_test.rb
gillbus-0.22.7 test/error_test.rb
gillbus-0.22.6 test/error_test.rb
gillbus-0.22.5 test/error_test.rb
gillbus-0.22.4 test/error_test.rb
gillbus-0.22.3 test/error_test.rb
gillbus-0.22.2 test/error_test.rb
gillbus-0.22.1 test/error_test.rb
gillbus-0.22.0 test/error_test.rb
gillbus-0.21.0 test/error_test.rb
gillbus-0.20.9 test/error_test.rb
gillbus-0.20.8 test/error_test.rb
gillbus-0.20.7 test/error_test.rb
gillbus-0.20.6 test/error_test.rb
gillbus-0.20.5 test/error_test.rb
gillbus-0.20.4 test/error_test.rb
gillbus-0.20.3 test/error_test.rb
gillbus-0.20.2 test/error_test.rb