OSDN Git Service

fix test
[pettanr/pettanr.git] / spec / factories / scroll.rb
index ba106f2..0efb1c2 100644 (file)
@@ -7,14 +7,10 @@ FactoryGirl.define do
     #association :author, factory: :author_yas\r
     trait :with_scroll_panels do\r
       after(:create) do |scroll, evaluator|\r
-        #panel_hello = create(:panel_hello, author: scroll.author)\r
         create(:scroll_panel_plain, t: 0, scroll: scroll, panel: create(:panel_hello, author: scroll.author))\r
-        panel_my_name = create(:panel_hello, author: scroll.author)\r
-        create(:scroll_panel_plain, t: 1, scroll: scroll, panel: panel_my_name)\r
-        panel_penjiro = create(:panel_hello, author: scroll.author)\r
-        create(:scroll_panel_plain, t: 2, scroll: scroll, panel: panel_penjiro)\r
-        panel_enjoy = create(:panel_hello, author: scroll.author)\r
-        create(:scroll_panel_plain, t: 3, scroll: scroll, panel: panel_enjoy)\r
+        create(:scroll_panel_plain, t: 1, scroll: scroll, panel: create(:panel_my_name, author: scroll.author))\r
+        create(:scroll_panel_plain, t: 2, scroll: scroll, panel: create(:panel_penjiro, author: scroll.author))\r
+        create(:scroll_panel_plain, t: 3, scroll: scroll, panel: create(:panel_enjoy, author: scroll.author))\r
       end\r
     end\r
     factory :scroll_hello_with_scroll_panels, traits: [:with_scroll_panels]\r
@@ -24,23 +20,20 @@ FactoryGirl.define do
     i.description '非公開の状態で作成したり、公開スクロールを非公開に変えるときに使う。'\r
     i.visible 0\r
   end\r
-  factory :scroll003, :class => Scroll do |i|\r
+  factory :scroll_itojun, :class => Scroll do |i|\r
     i.title 'aaaaaaaa'\r
     i.description ''\r
     i.visible 1\r
-    i.author_id 1\r
   end\r
-  factory :scroll004, :class => Scroll do |i|\r
+  factory :scroll_great, :class => Scroll do |i|\r
     i.title 'aaaaaaaa'\r
     i.description ''\r
     i.visible 1\r
-    i.author_id 1\r
   end\r
-  factory :scroll005, :class => Scroll do |i|\r
+  factory :scroll_diary, :class => Scroll do |i|\r
     i.title '投稿した直後'\r
     i.description ''\r
     i.visible 1\r
-    i.author_id 4\r
   end\r
   factory :scroll006, :class => Scroll do |i|\r
     i.title '投稿した直後'\r