Sha256: bdc0c4da9b6e092e9bfcce9ed0ce3ba33645763a364f90ad008c7afc8389557c

Contents?: true

Size: 1.58 KB

Versions: 4

Compression:

Stored size: 1.58 KB

Contents

# encoding: utf-8

require "spec_helper"

describe DpdApi::Order do
  include Savon::SpecHelper
  before(:all) { savon.mock!   }
  after(:all)  { savon.unmock! }

  let(:auth) do
    { request: {
      auth: {
        client_number: "234",
        client_key:    "123"
      } } }
  end
  let(:message) { auth.clone.deep_merge!({ request: params }) }

  # TODO: Add
  xcontext ".states_by_client_order" do
    let(:fixture) { File.read("spec/fixtures/dpd_api/tracing/states_by_client_order.xml") }
    let(:params) do
    end

    it "is success" do
      savon.expects(:get_states_by_client_order).with(message: message).returns(fixture)

      response = described_class.states_by_client_order(params)
      expect(response.first).to have_key(:parcel_status)
    end
  end

  # TODO: Add
  xcontext ".states_by_client_parcel" do
    let(:fixture) { File.read("spec/fixtures/dpd_api/tracing/states_by_client_parcel.xml") }
    let(:params) do
    end

    it "is success" do
      savon.expects(:get_states_by_client_parcel).with(message: message).returns(fixture)

      response = described_class.states_by_client_parcel(params)
      expect(response.first).to have_key(:parcel_status)
    end
  end

  # TODO: Add
  xcontext ".states_by_dpd_order" do
    let(:fixture) { File.read("spec/fixtures/dpd_api/tracing/states_by_dpd_order.xml") }
    let(:params) do
    end

    it "is success" do
      savon.expects(:get_states_by_dpd_order).with(message: message).returns(fixture)

      response = described_class.states_by_dpd_order(params)
      expect(response.first).to have_key(:parcel_status)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dpd_api-0.1.3 spec/lib/dpd_api/tracing_spec.rb
dpd_api-0.1.2 spec/lib/dpd_api/tracing_spec.rb
dpd_api-0.1.1 spec/lib/dpd_api/tracing_spec.rb
dpd_api-0.1.0 spec/lib/dpd_api/tracing_spec.rb