Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Forked from rgraff/gist:144005
Created July 9, 2009 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save patmaddox/144009 to your computer and use it in GitHub Desktop.
Save patmaddox/144009 to your computer and use it in GitHub Desktop.
# done
# -- Matthew Peychich
Factory.define :venue do |v|
v.name 'Foo Place'
v.url {Factory.next(:url_slug)}
v.address_hint 'MyString'
v.phone '(805) 555-1212'
v.capacity 'MyString'
v.website 'example.com'
v.image 'MyString'
v.description 'MyText'
v.directions 'MyText'
v.handicap_info 'MyText'
v.handicap_availability 0
v.custom_seattypes 'MyText'
v.geocode_latitude 9.99
v.geocode_longitude 9.99
v.active true
v.created_by_user {|a| a.association(:user)}
v.address {|a| a.association(:address)}
# Make sure the address has a matching postal_code object
unless PostalCode.find_by_country_name_and_postal_code(v.address.country)name, v.address.postal_code)
Factory(:postal_code, :country_name => v.address.country_name, :postal_code => v.address.postal_code)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment