1 # -*- encoding: utf-8 -*-
\r
2 FactoryGirl.define do
\r
3 factory :author_yas, :class => Author do |i|
\r
5 association :user, factory: :user_yas
\r
9 trait :with_scrolls do
\r
10 after(:create) do |author, evaluator|
\r
11 create_list(:scroll_hello, evaluator.scrolls_count, author: author)
\r
14 trait :with_contents do
\r
15 after(:create) do |author, evaluator|
\r
16 panel_hello = create(:panel_hello, author: author)
\r
17 scroll_hello = create(:scroll_hello, author: author)
\r
18 scroll_hello_panel_hello = create(:scroll_hello_panel_hello, scroll: scroll_hello, panel: panel_hello)
\r
21 factory :yas_with_scrolls, traits: [:with_scrolls]
\r
22 factory :yas_with_contents , traits: [:with_contents]
\r
24 factory :author_itojun, :class => Author do |i|
\r
27 factory :author003, :class => Author do |i|
\r
30 factory :author004, :class => Author do |i|
\r
33 factory :author005, :class => Author do |i|
\r