summaryrefslogtreecommitdiff
path: root/spec/models/spree/shipment_spec.rb
blob: 27f213bc3455e724bf43e8adb0ef20c2ec31ff94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
RSpec.describe Spree::Shipment do
  describe '#update' do
    subject { shipment.ship }

    let(:shipment) { create(:shipment, state: 'ready', order: order) }
    let(:order) { create :order_with_line_items }

    it 'fires the shipment_shipped event exactly once' do
      stub_const('Spree::Event', class_spy(Spree::Event))

      expect(Spree::Event).to receive(:fire).with('shipment_shipped', shipment: shipment).once

      subject
    end
  end
end