Sha256: 81831f90547d4fd698b8a30628b3fc72d598e87cffe514f76dc18b830c00dcb5

Contents?: true

Size: 567 Bytes

Versions: 4

Compression:

Stored size: 567 Bytes

Contents

require "test_helper"
require "russianpost/client"

class TestClient < MiniTest::Unit::TestCase
  def setup
    @client = RussianPost::Client.new
  end

  def test_returns_array_of_hashes
    VCR.use_cassette("valid_barcode") do
      response = @client.call(barcode: "RD025500807SE")
      assert_kind_of Array, response
      assert_kind_of Hash, response[0]
    end
  end

  def test_returns_nil_on_nonexistent_parcel
    VCR.use_cassette("nonexistent_parcel") do
      response = @client.call(barcode: "RR123456789EE")
      assert_nil response
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
russianpost-0.4.1 test/russianpost/client_test.rb
russianpost-0.4.0 test/russianpost/client_test.rb
russianpost-0.3.1 test/russianpost/client_test.rb
russianpost-0.3.0 test/russianpost/client_test.rb