Sha256: 31b566cd7de9235fcf2fcbe490ddaed22e2804108826612223d934c78ef6acd8

Contents?: true

Size: 1.72 KB

Versions: 46

Compression:

Stored size: 1.72 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

46 entries across 46 versions & 1 rubygems

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