Sha256: 0534eee0be6fd768b5c716c4e6c6861f766804f8959dbf7a576caec3b557551e

Contents?: true

Size: 582 Bytes

Versions: 10

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe SolidusBolt::Payments::VoidSyncService do
  subject(:void) { described_class.call(payment: payment) }

  let(:payment) { create(:bolt_payment) }

  describe '#call' do
    context 'when non-void payment' do
      it 'voids the payment' do
        expect { void }.to change { payment.reload.state }.from('checkout').to('void')
      end
    end

    context 'when void payment' do
      before { payment.update(state: 'void') }

      it 'returns nil' do
        expect(void).to be_nil
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_bolt-0.7.2 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.7.1 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.7.0 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.6.0 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.5.0 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.4.0 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.3.0 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.2.0 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.1.0 spec/services/solidus_bolt/payments/void_sync_service_spec.rb
solidus_bolt-0.0.1 spec/services/solidus_bolt/payments/void_sync_service_spec.rb