Using traits in FactoryGirl for things like tags on other models, and so forth.
FactoryGirl.define do
factory :post do
title 'New post'
end
trait :with_comments do
after :create do |post|
FactoryGirl.create_list :comment, 3, :post => post
end
end
end
FactoryGirl.create :post, :with_comments