Skip to content

Instantly share code, notes, and snippets.

@rianrainey
Created May 17, 2013 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rianrainey/5601663 to your computer and use it in GitHub Desktop.
Save rianrainey/5601663 to your computer and use it in GitHub Desktop.
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :user do
email: "john@doe.com"
factory :facilitator, :class => Facilitator do
sequence(:email) { |n| "facilitator#{n}@example.com" }
after(:build) { |pm| pm.company = FactoryGirl.build(:property_management_company) }
before(:create) { |pm| pm.company = FactoryGirl.create(:property_management_company) }
factory :property_manager_team_member, :class => PropertyManager do
admin false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment