Sha256: d750b83496e015c1eb85c528a5fc533d81204c35ffddbc500affde22eaed50f2

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'
require 'spree/testing_support/factories/store_credit_event_factory'

RSpec.describe 'store credit event factory' do
  let(:factory_class) { Spree::StoreCreditEvent }

  describe 'plain store credit event' do
    let(:factory) { :store_credit_event }


    it "builds successfully" do
      expect(build factory).to be_a(factory_class)
    end

    # No test for .create, as this base factory misses an `action`
    # and thus violates a NOT NULL constraint on e the DB
  end

  describe 'store credit auth event' do
    let(:factory) { :store_credit_auth_event }

    it_behaves_like 'a working factory'
  end

  describe 'store credit capture event' do
    let(:factory) { :store_credit_capture_event }

    it_behaves_like 'a working factory'
  end

  describe 'store credit adjustment event' do
    let(:factory) { :store_credit_adjustment_event }

    it_behaves_like 'a working factory'
  end

  describe 'store credit invalidate event' do
    let(:factory) { :store_credit_invalidate_event }

    it_behaves_like 'a working factory'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_core-1.2.3 spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb
solidus_core-1.2.2 spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb
solidus_core-1.2.1 spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb
solidus_core-1.2.0 spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb
solidus_core-1.2.0.rc2 spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb
solidus_core-1.2.0.rc1 spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb
solidus_core-1.2.0.beta1 spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb