Sha256: d12d4262346bd65a84690b94e021d7787556fcc103c00479917eedc319123412

Contents?: true

Size: 1015 Bytes

Versions: 31

Compression:

Stored size: 1015 Bytes

Contents

require "test_helper"

class BuyBookingTest < Minitest::Test

  def response
    Gillbus::BuyBooking::Response.parse_string(File.read('test/responses/buyBooking.xml'))
  end

  def test_request
    # TODO: Добавить тесты и имплементацию для всех данных что есть в доке
    request = Gillbus::BuyBooking::Request.new(
      payment_method: Gillbus::BuyBooking::Request::METHOD_NOCASH,
      ticket_count: 2,
      ticket_numbers: ["123456", "654321"],
      order_ids: ["53ec1fc6-e42a-42b2-b94f-1d5b47466526", "53ec1fc6-e42a-42b2-b94f-1d5b47466526"]
    )
    assert_equal({
      paymentMethod: 3,
      ticketCount: 2,
      ticketNumber0: "123456",
      ticketNumber1: "654321",
      orderId0: "53ec1fc6-e42a-42b2-b94f-1d5b47466526",
      orderId1: "53ec1fc6-e42a-42b2-b94f-1d5b47466526",
    }, request.params)
  end

  def test_response
    assert response.ticket.confirmation
    assert_equal [123456, 654321], response.ticket.position_numbers
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

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