Sha256: 5bd4913eef7b10ac076b108838e7dd41c633445018f85a8ad53f9345cc12be2e

Contents?: true

Size: 1.13 KB

Versions: 25

Compression:

Stored size: 1.13 KB

Contents

require 'test_helper'

class FindOrderTest < Minitest::Test
  def find_order
    Gillbus::FindOrder::Response.parse_string(File.read('test/responses/findOrder.xml'))
  end

  def find_order2
    Gillbus::FindOrder::Response.parse_string(File.read('test/responses/bookingDifferentCurrencies.xml'))
  end

  def test_number
    assert_equal('14482', find_order.tickets.first.ticket_number)
  end

  def test_total
    assert_equal(Money.new(20_46, 'UAH'), find_order.tickets.first.total_amount)
  end

  def test_status
    assert_equal(:ticketed, find_order.tickets.first.ticket_status)
  end

  def test_return_causes
    assert_equal(Money.new(20_38, 'UAH'), find_order.tickets.first.return_causes.first.approximate_amount)
  end

  def test_comission_vat_value
    assert_equal('18', find_order.tickets.last.commissions.first.vat_value)
  end

  def test_vat_value
    assert_equal('0', find_order.tickets.first.vat_value)
  end

  def test_comission_currency
    assert_equal(Money.new(51_55, 'RUB'), find_order2.tickets.last.commissions.last.value)
  end

  def test_online_refund
    assert_equal(true, find_order.tickets.first.is_online_refund)
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

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