Created
September 16, 2011 18:40
-
-
Save jwulff/1222772 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
require 'factory_girl_rails' | |
FactoryGirl.define do | |
BLUTHS = [ 'Annyong', | |
'Buster', | |
'George', | |
'George Michael', | |
'Gob', | |
'Lindsay', | |
'Lucille', | |
'Maeby', | |
'Michael', | |
'Oscar', | |
'Tobias' ] | |
FactoryGirl.define do | |
sequence(:email) { |n| "#{BLUTHS[n].downcase.gsub(' ', '_')}@bluth.com" } | |
sequence(:first_name) { |n| BLUTHS[n] } | |
end | |
factory :user do | |
password 'babybuster' | |
first_name | |
last_name 'Bluth' | |
end | |
factory :organization do | |
association :owner, :factory => :user | |
name 'Bluth Company' | |
subdomain 'bluth' | |
end | |
factory :organization_user do | |
organization | |
user | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment