Module | FactoryGirl::Syntax::Methods |
In: |
lib/factory_girl/syntax/methods.rb
|
Generates and returns a Hash of attributes from this factory. Attributes can be individually overridden by passing in a Hash of attribute => value pairs.
Arguments:
Returns: Hash A set of attributes that can be used to build an instance of the class this factory generates.
Generates and returns an instance from this factory. Attributes can be individually overridden by passing in a Hash of attribute => value pairs.
Arguments:
Returns: Object An instance of the class this factory generates, with generated attributes assigned.
Builds and returns multiple instances from this factory as an array. Attributes can be individually overridden by passing in a Hash of attribute => value pairs.
Arguments:
Returns: Array An array of instances of the class this factory generates, with generated attributes assigned.
Generates and returns an object with all attributes from this factory stubbed out. Attributes can be individually overridden by passing in a Hash of attribute => value pairs.
Arguments:
Returns: Object An object with generated attributes stubbed out.
Generates, saves, and returns an instance from this factory. Attributes can be individually overridden by passing in a Hash of attribute => value pairs.
Instances are saved using the +save!+ method, so ActiveRecord models will raise ActiveRecord::RecordInvalid exceptions for invalid attribute sets.
Arguments:
Returns: Object A saved instance of the class this factory generates, with generated attributes assigned.
Creates and returns multiple instances from this factory as an array. Attributes can be individually overridden by passing in a Hash of attribute => value pairs.
Arguments:
Returns: Array An array of instances of the class this factory generates, with generated attributes assigned.