Sha256: 4f768695c5866c130616e1188235c6ddeaac9993ffb0b0c11a6b8b61ef1731ed

Contents?: true

Size: 1.63 KB

Versions: 31

Compression:

Stored size: 1.63 KB

Contents

require 'test_helper'

class LockSeatsRequestTest < Minitest::Test
  def test_lock_params
    request = Gillbus::LockSeats::Request.new(
      trip_id: "2457369573939592570",
    )
    assert_equal({
      tripId: "2457369573939592570",
    }, request.params)
  end

  def test_lock_params_with_seats
    request = Gillbus::LockSeats::Request.new(
      trip_id: "2457369573939592570",
      seat_ids: ["12", "13"],
    )
    assert_equal({
      tripId: "2457369573939592570",
      seatId0: "12",
      seatId1: "13",
    }, request.params)
  end

  def test_lock_params_with_back_seats
    request = Gillbus::LockSeats::Request.new(
      trip_id: "2457369573939592570",
      seat_ids: ["12", "13"],
      back_seat_ids: ["14", "15"],
    )
    assert_equal({
      tripId: "2457369573939592570",
      seatId0: "12",
      seatId1: "13",
      backSeatId0: "14",
      backSeatId1: "15",
    }, request.params)
  end

  def test_lock_params_with_segments_seats
    request = Gillbus::LockSeats::Request.new(
      trip_id: "2457369573939592570",
      segments_seat_ids: {
        0 => ["12", "13"],
        1 => ["14", "15"],
      }
    )
    assert_equal({
      tripId: "2457369573939592570",
      segment0seatId0: "12",
      segment0seatId1: "13",
      segment1seatId0: "14",
      segment1seatId1: "15",
    }, request.params)
  end
end

class LockSeatsResponseTest < Minitest::Test
  def lock_seats
    Gillbus::LockSeats::Response.parse_string(File.read('test/responses/lockSeats.xml'))
  end

  def test_lock_seats
    assert_equal( 899, lock_seats.time_limit)
  end

  def test_dictionary
    assert_equal true, lock_seats.dictionary[:mail]
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
gillbus-0.16.7 test/lock_seats_test.rb
gillbus-0.16.6 test/lock_seats_test.rb
gillbus-0.16.5 test/lock_seats_test.rb
gillbus-0.16.4 test/lock_seats_test.rb
gillbus-0.16.3 test/lock_seats_test.rb
gillbus-0.16.2 test/lock_seats_test.rb
gillbus-0.16.1 test/lock_seats_test.rb
gillbus-0.15.7 test/lock_seats_test.rb
gillbus-0.15.6 test/lock_seats_test.rb
gillbus-0.15.5 test/lock_seats_test.rb
gillbus-0.15.4 test/lock_seats_test.rb
gillbus-0.15.3 test/lock_seats_test.rb
gillbus-0.15.2 test/lock_seats_test.rb
gillbus-0.15.1 test/lock_seats_test.rb
gillbus-0.15.0 test/lock_seats_test.rb
gillbus-0.14.12 test/lock_seats_test.rb
gillbus-0.14.11 test/lock_seats_test.rb
gillbus-0.14.10 test/lock_seats_test.rb
gillbus-0.14.9 test/lock_seats_test.rb
gillbus-0.14.8 test/lock_seats_test.rb