Sha256: 4ebe73095a0bd2a64b61d57d622194a25d254724757da1d5bddc43e61b648031

Contents?: true

Size: 1015 Bytes

Versions: 21

Compression:

Stored size: 1015 Bytes

Contents

# frozen_string_literal: true

require 'spree/testing_support/factories/store_credit_factory'
require 'spree/testing_support/factories/store_credit_reason_factory'

FactoryBot.define do
  factory :store_credit_event, class: 'Spree::StoreCreditEvent' do
    store_credit
    amount             { 100.00 }
    authorization_code { "#{store_credit.id}-SC-20140602164814476128" }

    factory :store_credit_auth_event, class: 'Spree::StoreCreditEvent' do
      action             { Spree::StoreCredit::AUTHORIZE_ACTION }
    end

    factory :store_credit_capture_event do
      action             { Spree::StoreCredit::CAPTURE_ACTION }
    end

    factory :store_credit_adjustment_event do
      action              { Spree::StoreCredit::ADJUSTMENT_ACTION }
      store_credit_reason { create(:store_credit_reason) }
    end

    factory :store_credit_invalidate_event do
      action              { Spree::StoreCredit::INVALIDATE_ACTION }
      store_credit_reason { create(:store_credit_reason) }
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
solidus_core-2.10.5 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.10.3 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.10.2 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.9.6 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.8.6 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.10.1 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.9.5 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.10.0 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.9.4 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.8.5 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.9.3 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.9.2 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.10.0.beta1 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.9.1 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.9.0 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.9.0.rc.1 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.8.4 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.8.3 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.8.2 lib/spree/testing_support/factories/store_credit_event_factory.rb
solidus_core-2.8.1 lib/spree/testing_support/factories/store_credit_event_factory.rb