OSDN Git Service

fix js manifest
[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     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
19       end\r
20     end\r
21     factory :yas_with_scrolls, traits: [:with_scrolls]\r
22     factory :yas_with_contents , traits: [:with_contents]\r
23   end\r
24   factory :author_itojun, :class => Author do |i|\r
25     i.name 'itojun'\r
26   end\r
27   factory :author003, :class => Author do |i|\r
28     i.name 'qqqqqq'\r
29   end\r
30   factory :author004, :class => Author do |i|\r
31     i.name 'やる気満々'\r
32   end\r
33   factory :author005, :class => Author do |i|\r
34     i.name 'z6'\r
35   end\r
36 end\r