Sha256: 61b255022a0c7abe001757929d3c6dcb2c4309459e6fae91a6fe485a31a2398c

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 Bytes

Contents

require 'test_helper'
require 'russianpost/client'

class TestClient < Minitest::Test
  def setup
    @client = RussianPost::Client.instance
  end

  def test_returns_array_of_hashes_on_existing_parcel
    ['RD025500807SE', 'LK035658376US'].each do |code|
      VCR.use_cassette(code) do
        response = @client.call(barcode: code)
        assert_kind_of Array, response
        assert_kind_of Hash, response[0]
      end
    end
  end

  def test_returns_empty_array_on_nonexistent_parcel
    VCR.use_cassette('RR123456789EE') do
      response = @client.call(barcode: 'RR123456789EE')
      assert_kind_of Array, response
      assert_empty response
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
russianpost-0.7.0 test/russianpost/client_test.rb