X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=spec%2Ffactories%2Fauthor.rb;fp=spec%2Ffactories%2Fauthor.rb;h=6274e25164ee8f9804a2bb75c62c13f345f55450;hp=85f1ae0beac313dc47c7e6c0a01a3b75de4d0f0a;hb=f20e087a523621b9e3efc6778509267fc25e5a70;hpb=afa4bb5b1dcd29e3210562bcc12acf8d87f607ee diff --git a/spec/factories/author.rb b/spec/factories/author.rb index 85f1ae0b..6274e251 100644 --- a/spec/factories/author.rb +++ b/spec/factories/author.rb @@ -11,7 +11,15 @@ FactoryGirl.define do create_list(:scroll_hello, evaluator.scrolls_count, author: author) end end + trait :with_contents do + after(:create) do |author, evaluator| + panel_hello = create(:panel_hello, author: author) + scroll_hello = create(:scroll_hello, author: author) + scroll_hello_panel_hello = create(:scroll_hello_panel_hello, scroll: scroll_hello, panel: panel_hello) + end + end factory :yas_with_scrolls, traits: [:with_scrolls] + factory :yas_with_contents , traits: [:with_contents] end factory :author_itojun, :class => Author do |i| i.name 'itojun'