OSDN Git Service

fix test
[pettanr/pettanr.git] / spec / factories / scroll.rb
1 # -*- encoding: utf-8 -*-\r
2 FactoryGirl.define do\r
3   factory :scroll_hello, :class => Scroll do |i|\r
4     i.title 'おめざめ2'\r
5     i.description ''\r
6     i.visible 1\r
7     #association :author, factory: :author_yas\r
8     trait :with_scroll_panels do\r
9       after(:create) do |scroll, evaluator|\r
10         create(:scroll_panel_plain, t: 0, scroll: scroll, panel: create(:panel_hello, author: scroll.author))\r
11         create(:scroll_panel_plain, t: 1, scroll: scroll, panel: create(:panel_my_name, author: scroll.author))\r
12         create(:scroll_panel_plain, t: 2, scroll: scroll, panel: create(:panel_penjiro, author: scroll.author))\r
13         create(:scroll_panel_plain, t: 3, scroll: scroll, panel: create(:panel_enjoy, author: scroll.author))\r
14       end\r
15     end\r
16     factory :scroll_hello_with_scroll_panels, traits: [:with_scroll_panels]\r
17   end\r
18   factory :scroll_hidden, :class => Scroll do |i|\r
19     i.title '非公開のスクロール'\r
20     i.description '非公開の状態で作成したり、公開スクロールを非公開に変えるときに使う。'\r
21     i.visible 0\r
22   end\r
23   factory :scroll_itojun, :class => Scroll do |i|\r
24     i.title 'aaaaaaaa'\r
25     i.description ''\r
26     i.visible 1\r
27   end\r
28   factory :scroll_great, :class => Scroll do |i|\r
29     i.title 'aaaaaaaa'\r
30     i.description ''\r
31     i.visible 1\r
32   end\r
33   factory :scroll_diary, :class => Scroll do |i|\r
34     i.title '投稿した直後'\r
35     i.description ''\r
36     i.visible 1\r
37   end\r
38   factory :scroll006, :class => Scroll do |i|\r
39     i.title '投稿した直後'\r
40     i.description ''\r
41     i.visible 1\r
42     i.author_id 1\r
43   end\r
44   factory :scroll007, :class => Scroll do |i|\r
45     i.title '「はてなブックマーク」が、重すぎる'\r
46     i.description 'zzzz'\r
47     i.visible 1\r
48     i.author_id 1\r
49   end\r
50   factory :scroll008, :class => Scroll do |i|\r
51     i.title '投稿した直後2'\r
52     i.description 'qwe'\r
53     i.visible 1\r
54     i.author_id 1\r
55   end\r
56 end\r