Sha256: 752eb28cf168fae9404e3019957dafd55ffb6dda84c5e36392faecdf0da71a5a

Contents?: true

Size: 1.25 KB

Versions: 28

Compression:

Stored size: 1.25 KB

Contents

FactoryGirl.define do
  factory :order do |f|
    email 'john@nimbleshop.com'
    shipping_address
    association :shipping_method, factory: :country_shipping_method
    sequence(:number) { |t| "xxx#{t}" }

    trait :line_items do
      after(:create) { |order| FactoryGirl.create(:line_item, order: order) }
    end

    trait :splitable do
      payment_method_id 1
    end

    trait :paypalwp do
      payment_method_id 2
    end

    trait :authorizedotnet do
      payment_method_id 3
    end

    trait :shipment do
      after(:create) { |order| FactoryGirl.create(:shipment, order: order) }
    end

    factory :order_with_line_items,   traits: [:line_items]

    factory :order_paid_using_splitable,   traits: [:splitable] do |order|
      order.after(:create) do |o|
        create :payment_transaction_with_splitable, order: o
      end
    end

    factory :order_paid_using_paypalwp,   traits: [:paypalwp] do |order|
      order.after(:create) do |o|
        create :payment_transaction_with_paypalwp, order: o
      end
    end

    factory :order_paid_using_authorizedotnet,   traits: [:authorizedotnet, :shipment] do |order|
      order.after(:create) do |o|
        create :payment_transaction_with_authorizedotnet, order: o
      end
    end

  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
nimbleshop_core-0.0.20 test/factories/order_factory.rb
nimbleshop_core-0.0.19 test/factories/order_factory.rb
nimbleshop_core-0.0.17 test/factories/order_factory.rb
nimbleshop_core-0.0.16 test/factories/order_factory.rb
nimbleshop_core-0.0.15 test/factories/order_factory.rb
nimbleshop_core-0.0.14 test/factories/order_factory.rb
nimbleshop_core-0.0.14.rc2 test/factories/order_factory.rb
nimbleshop_core-0.0.14.rc1 test/factories/order_factory.rb
nimbleshop_core-0.0.13 test/factories/order_factory.rb
nimbleshop_core-0.0.12 test/factories/order_factory.rb
nimbleshop_core-0.0.11 test/factories/order_factory.rb
nimbleshop_core-0.0.10 test/factories/order_factory.rb
nimbleshop_core-0.0.9 test/factories/order_factory.rb
nimbleshop_core-0.0.8 test/factories/order_factory.rb
nimbleshop_core-0.0.7 test/factories/order_factory.rb
nimbleshop_core-0.0.5 test/factories/order_factory.rb
nimbleshop_core-0.0.4.beta1 test/factories/order_factory.rb
nimbleshop_core-0.0.4 test/factories/order_factory.rb
nimbleshop_core-0.0.3 test/factories/order_factory.rb
nimbleshop_core-0.0.2 test/factories/order_factory.rb