Skip to content

Instantly share code, notes, and snippets.

@rianrainey
Created May 17, 2013 20:06
Show Gist options
  • 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: "[email protected]"
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