Sha256: f85bdd1bb4d9d9a5db9981623b01ab71be013a48a334201ce2bdba4c1aeb0bc3
Contents?: true
Size: 724 Bytes
Versions: 22
Compression:
Stored size: 724 Bytes
Contents
shared_examples_for "an adjustment source" do subject(:source) { described_class.create } before do allow(Spree::Adjustable::AdjustmentsUpdater).to receive(:update) order.adjustments.create(order: order, amount: 10, label: 'Adjustment', source: source) end describe '#destroy' do before { source.destroy } context 'when order incomplete' do let(:order) { create(:order_with_line_items) } it { expect(order.adjustments.count).to eq(0) } end context 'when order is complete' do let(:order) { create(:completed_order_with_totals) } it { expect(order.adjustments.count).to eq(1) } it { expect(order.adjustments.reload.first.source).to be_nil } end end end
Version data entries
22 entries across 22 versions & 1 rubygems