Sha256: cad5a28d8466f1454bba57ad6b944886792e76a5280c5a29bac4df2058e89512

Contents?: true

Size: 807 Bytes

Versions: 46

Compression:

Stored size: 807 Bytes

Contents

require 'test_helper'

class ReturnPositionTest < Minitest::Test
  def test_request
    request = Gillbus::ReturnPosition::Request.new(
      ticket_count: 1,
      system_numbers: [123456],
    )

    assert_equal(
      {
        ticketCount: 1,
        systemNumber0: 123456,
      },
      request.params,
    )
  end

  def test_success_response
    assert success_response.return_positions.first.confirmation
  end

  def test_failure_response
    refute failure_response.return_positions.first.confirmation
  end

  private

  def success_response
    Gillbus::ReturnPosition::Response.parse_string(File.read('test/responses/returnPositionSuccess.xml'))
  end

  def failure_response
    Gillbus::ReturnPosition::Response.parse_string(File.read('test/responses/returnPositionFailure.xml'))
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

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