Created
February 19, 2011 00:41
-
-
Save kirkconnell/834683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Factory.define :seattle_profile_with_products, :parent => :profile do |f| | |
f.primary_address { Factory.create(:primary_address) } | |
f.profile_type do | |
pt = ProfileType.find_by_name('County Profile') | |
pt ||= Factory.create(:profile_type, :name => "County Profile") | |
end | |
f.after_create do |profile| | |
Factory.create :seattle_loc | |
Factory.create :seattle_zip_loc | |
product = Factory.create(:product_in_king_county, :site => profile.site) | |
profile.locations << product.locations | |
profile.entity.products << product | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment