spec/support/factory.rb in restpack_serializer-0.4.27 vs spec/support/factory.rb in restpack_serializer-0.4.28

- old
+ new

@@ -12,10 +12,19 @@ after(:create) do |artist, evaluator| create_list(:album_with_songs, evaluator.album_count, artist: artist) end end + + factory :artist_with_fans do + ignore do + fans_count 3 + end + after(:create) do |artist, evaluator| + create_list(:payment, evaluator.fans_count, artist: artist) + end + end end factory :album, :class => MyApp::Album do sequence(:title) {|n| "Album ##{n}" } sequence(:year) {|n| 1960 + n } @@ -39,7 +48,12 @@ end factory :payment, :class => MyApp::Payment do amount 999 artist + fan + end + + factory :fan, :class => MyApp::Fan do + sequence(:name) {|n| "Fan ##{n}"} end end