Sha256: 52f8607e57c47ce3c405f5807867f46a8b1a41c3251d3720daca08adf6b1f006

Contents?: true

Size: 822 Bytes

Versions: 19

Compression:

Stored size: 822 Bytes

Contents

FactoryGirl.define do
  factory :payment, aliases: [:credit_card_payment], class: Spree::Payment do
    amount 45.75
    association(:payment_method, factory: :credit_card_payment_method)
    association(:source, factory: :credit_card)
    order
    state 'checkout'
    response_code '12345'

    factory :payment_with_refund do
      state 'completed'
      after :create do |payment|
        create(:refund, amount: 5, payment: payment)
      end
    end
  end

  factory :check_payment, class: Spree::Payment do
    amount 45.75
    association(:payment_method, factory: :check_payment_method)
    order
  end

  factory :store_credit_payment, class: Spree::Payment, parent: :payment do
    association(:payment_method, factory: :store_credit_payment_method)
    association(:source, factory: :store_credit)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
solidus_core-1.1.4 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.7 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.6 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.1.3 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.5 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.4 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.1.2 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.3 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.1.1 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.1.0 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.1.0.pre2 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.1.0.pre1 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.1.0.beta1 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.2 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.1 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.0 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.0.rc2 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.0.rc1 lib/spree/testing_support/factories/payment_factory.rb
solidus_core-1.0.0.pre3 lib/spree/testing_support/factories/payment_factory.rb