Sha256: f7c5dca558347eb7054a4e31fb220e8ca7cb7e772a4368c8364abde9a3b94117

Contents?: true

Size: 1.03 KB

Versions: 11

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe EasyPost::Order do
  describe '#create' do
    it 'creates an order out of a single shipment' do
      order = EasyPost::Order.create(
        to_address: ADDRESS[:california],
        from_address: ADDRESS[:missouri],
        shipments: [{
          parcel: {length: 8, width: 6, height: 4, weight: 12}
        }]
      )

      expect(order).to be_an_instance_of(EasyPost::Order)
      expect(order.shipments.first).to be_an_instance_of(EasyPost::Shipment)
    end

    it 'creates an order out of two shipments' do
      order = EasyPost::Order.create(
        to_address: ADDRESS[:california],
        from_address: ADDRESS[:missouri],
        carrier_accounts: [{id: "ca_12345678"}],
        shipments: [{
          parcel: {length: 8, width: 6, height: 4, weight: 12}
        },{
          parcel: {length: 8, width: 6, height: 4, weight: 12}
        }]
      )

      expect(order).to be_an_instance_of(EasyPost::Order)
      expect(order.shipments.first).to be_an_instance_of(EasyPost::Shipment)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
easypost-2.6.1 spec/order_spec.rb
easypost-2.6.0 spec/order_spec.rb
easypost-2.5.0 spec/order_spec.rb
easypost-2.4.0 spec/order_spec.rb
easypost-2.3.0 spec/order_spec.rb
easypost-2.2.0 spec/order_spec.rb
easypost-2.1.11 spec/order_spec.rb
easypost-2.1.10 spec/order_spec.rb
easypost-2.1.9 spec/order_spec.rb
easypost-2.1.8 spec/order_spec.rb
easypost-2.1.7 spec/order_spec.rb