# -*- encoding: utf-8 -*-\r
FactoryGirl.define do\r
- factory :story001, :class => Story do |i|\r
- i.title '区別がつかな'\r
- i.description ''\r
- i.t \r
+ factory :story_install, :class => Story do |i|\r
+ i.title 'インストール'\r
+ i.description 'ダウンロードからHello worldまで。'\r
i.visible 1\r
- i.author_id 1\r
+ trait :with_story_sheets do\r
+ after(:create) do |story, evaluator|\r
+ create(:sheet_install_a, author: story.author)\r
+ create(:story_sheet_plain, t: 0, story: story, sheet: create(:sheet_install_a_with_sheet_panels, author: story.author))\r
+ create(:story_sheet_plain, t: 1, story: story, sheet: create(:sheet_install_b, author: story.author))\r
+ end\r
+ end\r
+ factory :story_install_with_story_sheets, traits: [:with_story_sheets]\r
end\r
- factory :story002, :class => Story do |i|\r
- i.title '絵師ã\81®é\83½å\90\88'\r
+ factory :story_setup, :class => Story do |i|\r
+ i.title '管ç\90\86è\80\85ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\82\92æº\96å\82\99ã\81\99ã\82\8b'\r
i.description ''\r
- i.t \r
i.visible 1\r
- i.author_id 1\r
+ trait :with_story_sheets do\r
+ after(:create) do |story, evaluator|\r
+ create(:story_sheet_plain, t: 0, story: story, sheet: create(:sheet_setup_a, author: story.author))\r
+ create(:story_sheet_plain, t: 1, story: story, sheet: create(:sheet_setup_b, author: story.author))\r
+ end\r
+ end\r
+ factory :story_setup_with_story_sheets, traits: [:with_story_sheets]\r
end\r
factory :story003, :class => Story do |i|\r
i.title 'キツネが憑いている'\r