spec/support/factory.rb in restpack_serializer-0.5.3 vs spec/support/factory.rb in restpack_serializer-0.5.4

- old
+ new

@@ -21,10 +21,19 @@ end after(:create) do |artist, evaluator| create_list(:payment, evaluator.fans_count, artist: artist) end end + + factory :artist_with_stalkers do + ignore do + stalker_count 2 + end + after(:create) do |artist, evaluator| + create_list(:stalker, evaluator.stalker_count, artists: [ artist ]) + end + end end factory :album, :class => MyApp::Album do sequence(:title) {|n| "Album ##{n}" } sequence(:year) {|n| 1960 + n } @@ -53,7 +62,11 @@ fan end factory :fan, :class => MyApp::Fan do sequence(:name) {|n| "Fan ##{n}"} + end + + factory :stalker, :class => MyApp::Stalker do + sequence(:name) {|n| "Stalker ##{n}"} end end