Sha256: 07e123a570e63c125ec7d01378609833fcaa05c7c5710bff21d7bcfae007784e

Contents?: true

Size: 653 Bytes

Versions: 10

Compression:

Stored size: 653 Bytes

Contents

require 'spec_helper'

RSpec.describe SolidusBolt::PaymentDecorator do
  describe '#can_void?' do
    [
      'checkout',
      'completed',
      'processing',
      'failed',
      'void',
      'invalid'
    ].each do |state|
      let(:payment) { Spree::Payment.new(state: state) }

      context "when payment state is #{state}" do
        it 'return false' do
          expect(payment.can_void?).to eq false
        end
      end
    end

    context "when payment state is pending" do
      let(:payment) { Spree::Payment.new(state: 'pending') }

      it 'return true' do
        expect(payment.can_void?).to eq true
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_bolt-0.7.2 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.7.1 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.7.0 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.6.0 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.5.0 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.4.0 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.3.0 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.2.0 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.1.0 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
solidus_bolt-0.0.1 spec/decorators/models/solidus_bolt/payment_decorator_spec.rb