Sha256: 249c6d3ee9425d443e26831317d9cd3e506899327accdb2031357b61da1ed48a

Contents?: true

Size: 845 Bytes

Versions: 1

Compression:

Stored size: 845 Bytes

Contents

require "spec_helper"

module ShipCompliant

  describe GetInventoryDetails do

    before { savon.mock! }
    after { savon.unmock! }

    it "gets inventory details" do
      message = {
        'Request' => {
          'Security' => {
            'PartnerKey' => 'abc-123',
            'Username' => 'bob@example.com',
            'Password' => 'secret'
          },
          'BrandKey' => 'BRAND-KEY',
          'FulfillmentLocation' => 'FULFILLMENT-LOCATION',
        }
      }

      savon.expects(:get_inventory_details)
        .with(message: message)
        .returns(File.read('spec/fixtures/void_order_success.xml'))

      result = GetInventoryDetails.call(
        brand_key: 'BRAND-KEY',
        fulfillment_location: 'FULFILLMENT-LOCATION'
      )

      expect(result).to be_kind_of(GetInventoryDetailsResult)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ship_compliant-0.2.1 spec/lib/ship_compliant/get_inventory_details_spec.rb