Sha256: e8391ca5816583c03b8466ec0bf9c7acc77c29fa573cf7c0df4683ff8233beb6
Contents?: true
Size: 1.01 KB
Versions: 5
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true RSpec.describe SolidusSubscriptions::Dispatcher::SuccessDispatcher do describe '#dispatch' do it 'marks the installment as success' do installment = instance_spy(SolidusSubscriptions::Installment) order = create(:order_with_line_items) dispatcher = described_class.new(installment, order) dispatcher.dispatch expect(installment).to have_received(:success!).with(order) end it 'fires an installments_succeeded event' do stub_const('SolidusSupport::LegacyEventCompat::Bus', class_spy(SolidusSupport::LegacyEventCompat::Bus)) installment = instance_spy(SolidusSubscriptions::Installment) order = create(:order_with_line_items) dispatcher = described_class.new(installment, order) dispatcher.dispatch expect(SolidusSupport::LegacyEventCompat::Bus).to have_received(:publish).with( :'solidus_subscriptions.installment_succeeded', installment: installment, order: order, ) end end end
Version data entries
5 entries across 5 versions & 1 rubygems