Skip to content

Instantly share code, notes, and snippets.

@cored
Last active December 27, 2017 12:42
Show Gist options
  • Save cored/add042a65b8b68b7c25ed46b13024586 to your computer and use it in GitHub Desktop.
Save cored/add042a65b8b68b7c25ed46b13024586 to your computer and use it in GitHub Desktop.
describe "#cancel_slot" do
let(:courier_slot) do
instance_double("CourierSlot", external_api_identifier: "api_identifier")
end
let(:cancel_slot) do
instance_double("EasyPost::Carriers::CancelSlot", ez_shipment: ez_shipment)
end
let(:ez_shipment) do
instance_double("EasyPost::Carriers::CancelSlot")
end
before do
allow(EasyPost::Carriers::CancelSlot).to receive(:call) { cancel_slot }
end
it "delegates the carrier cancelation slot" do
described_class.new.cancel_slot(courier_slot)
expect(EasyPost::Carriers::CancelSlot).to have_received(:call)
.with("api_identifier")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment