Class | FactoryGirl::Factory |
In: |
lib/factory_girl/factory.rb
|
Parent: | Object |
Names for this factory, including aliases.
Example:
factory :user, :aliases => [:author] do # ... end FactoryGirl.create(:author).class # => User
Because an attribute defined without a value or block will build an association with the same name, this allows associations to be defined without factories, such as:
factory :user, :aliases => [:author] do # ... end factory :post do author end FactoryGirl.create(:post).author.class # => User