Skip to content

Instantly share code, notes, and snippets.

@takuyan
Created December 27, 2012 13:20
Show Gist options
  • Save takuyan/4388339 to your computer and use it in GitHub Desktop.
Save takuyan/4388339 to your computer and use it in GitHub Desktop.
# This will guess the User class
FactoryGirl.define do
factory :user do
first_name "John"
last_name "Doe"
admin false
end
# This will use the User class (Admin would have been guessed)
factory :admin, class: User do
first_name "Admin"
last_name "User"
admin true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment