OSDN Git Service

fix peta test
[pettanr/pettanr.git] / spec / factories / story.rb
1 # -*- encoding: utf-8 -*-\r
2 FactoryGirl.define do\r
3   factory :story_install, :class => Story do |i|\r
4     i.title 'インストール'\r
5     i.description 'ダウンロードからHello worldまで。'\r
6     i.visible 1\r
7     trait :with_story_sheets do\r
8       after(:create) do |story, evaluator|\r
9       create(:sheet_install_a, author: story.author)\r
10         create(:story_sheet_plain, t: 0, story: story, sheet: create(:sheet_install_a_with_sheet_panels, author: story.author))\r
11         create(:story_sheet_plain, t: 1, story: story, sheet: create(:sheet_install_b, author: story.author))\r
12       end\r
13     end\r
14     factory :story_install_with_story_sheets, traits: [:with_story_sheets]\r
15   end\r
16   factory :story_setup, :class => Story do |i|\r
17     i.title '管理者アカウントを準備する'\r
18     i.description ''\r
19     i.visible 1\r
20     trait :with_story_sheets do\r
21       after(:create) do |story, evaluator|\r
22         create(:story_sheet_plain, t: 0, story: story, sheet: create(:sheet_setup_a, author: story.author))\r
23         create(:story_sheet_plain, t: 1, story: story, sheet: create(:sheet_setup_b, author: story.author))\r
24       end\r
25     end\r
26     factory :story_setup_with_story_sheets, traits: [:with_story_sheets]\r
27   end\r
28   factory :story003, :class => Story do |i|\r
29     i.title 'キツネが憑いている'\r
30     i.description ''\r
31     i.t \r
32     i.visible 1\r
33     i.author_id 1\r
34   end\r
35   factory :story004, :class => Story do |i|\r
36     i.title '刑務所に隔離'\r
37     i.description ''\r
38     i.t \r
39     i.visible 1\r
40     i.author_id 1\r
41   end\r
42   factory :story005, :class => Story do |i|\r
43     i.title '海賊行為に精を出す守護大名'\r
44     i.description ''\r
45     i.t \r
46     i.visible 1\r
47     i.author_id 1\r
48   end\r
49   factory :story006, :class => Story do |i|\r
50     i.title 'プログラマとお金'\r
51     i.description ''\r
52     i.t \r
53     i.visible 0\r
54     i.author_id 1\r
55   end\r
56   factory :story007, :class => Story do |i|\r
57     i.title 'プログラマとお金(_完全版)'\r
58     i.description ''\r
59     i.t \r
60     i.visible 1\r
61     i.author_id 1\r
62   end\r
63 end\r