2014-12-04 19:50:02 +01:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: orders
|
|
|
|
#
|
2015-09-14 11:20:52 +02:00
|
|
|
# id :integer not null, primary key
|
|
|
|
# user_id :integer
|
|
|
|
# price_cents :integer
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
# transaction_id :integer
|
2014-12-04 19:50:02 +01:00
|
|
|
#
|
|
|
|
|
2015-09-02 20:33:35 +02:00
|
|
|
require 'faker'
|
|
|
|
|
|
|
|
FactoryGirl.define do
|
|
|
|
factory :order do
|
|
|
|
user
|
2015-09-04 16:47:49 +02:00
|
|
|
transient do
|
|
|
|
products_count 1
|
|
|
|
end
|
|
|
|
before(:create) do |order, evaluator|
|
|
|
|
order.order_items << create_list(:order_item, evaluator.products_count, order: order)
|
2015-09-02 20:33:35 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|