OSDN Git Service

85f1ae0beac313dc47c7e6c0a01a3b75de4d0f0a
[pettanr/pettanr.git] / spec / factories / author.rb
1 # -*- encoding: utf-8 -*-\r
2 FactoryGirl.define do\r
3   factory :author_yas, :class => Author do |i|\r
4     i.name 'ペン次郎'\r
5     association :user, factory: :user_yas\r
6     ignore do\r
7       scrolls_count 5\r
8     end\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
12       end\r
13     end\r
14     factory :yas_with_scrolls, traits: [:with_scrolls]\r
15   end\r
16   factory :author_itojun, :class => Author do |i|\r
17     i.name 'itojun'\r
18   end\r
19   factory :author003, :class => Author do |i|\r
20     i.name 'qqqqqq'\r
21   end\r
22   factory :author004, :class => Author do |i|\r
23     i.name 'やる気満々'\r
24   end\r
25   factory :author005, :class => Author do |i|\r
26     i.name 'z6'\r
27   end\r
28 end\r