OSDN Git Service

fix peta spec
[pettanr/pettanr.git] / spec / factories / scroll.rb
index c80f5e0..f74dd92 100644 (file)
@@ -29,6 +29,14 @@ FactoryGirl.define do
     i.title 'aaaaaaaa'\r
     i.description ''\r
     i.visible 1\r
+    trait :with_scroll_panels do\r
+      after(:create) do |scroll, evaluator|\r
+        create(:scroll_panel_plain, t: 0, scroll: scroll, panel: create(:panel_great, author: scroll.author))\r
+        create(:scroll_panel_plain, t: 1, scroll: scroll, panel: create(:panel_awesome, author: scroll.author))\r
+        create(:scroll_panel_plain, t: 2, scroll: scroll, panel: create(:panel_wonderful, author: scroll.author))\r
+      end\r
+    end\r
+    factory :scroll_great_with_scroll_panels, traits: [:with_scroll_panels]\r
   end\r
   factory :scroll_diary, :class => Scroll do |i|\r
     i.title '投稿した直後'\r