Skip to content
This repository

A library for setting up Ruby objects as test data.

Clarify documentation on using initialize_with

Using ignore blocks to avoid duplicate assignment is obsolete since
factory_girl 4.0.

Closes #622
latest commit 493c9ad031
Emil Sågfors lime authored March 07, 2014 joshuaclayton committed April 19, 2014
Octocat-spinner-32 features Convert to expect syntax January 18, 2013
Octocat-spinner-32 gemfiles Bump version to 4.4.0 February 11, 2014
Octocat-spinner-32 lib a minor change to inform the user what model and method violated the … April 19, 2014
Octocat-spinner-32 spec a minor change to inform the user what model and method violated the … April 19, 2014
Octocat-spinner-32 .autotest Remove whitespace [ WhitespaceBot] October 21, 2011
Octocat-spinner-32 .gitignore Ignore bin dir from bundler March 09, 2012
Octocat-spinner-32 .rspec Use rspec2 November 11, 2010
Octocat-spinner-32 .simplecov Clean up SimpleCov usage April 23, 2012
Octocat-spinner-32 .travis.yml Add Ruby 2.1.0 to .travis.yml February 09, 2014
Octocat-spinner-32 .yardopts Converted the contribution guidelines; updates to readme February 07, 2011
Octocat-spinner-32 Appraisals Update versions of Rails for Appraisal November 02, 2013
Octocat-spinner-32 http => https January 12, 2012
Octocat-spinner-32 Clarify documentation on using initialize_with April 19, 2014
Octocat-spinner-32 Gemfile Syntax tweak March 20, 2014
Octocat-spinner-32 Gemfile.lock Bump version to 4.4.0 February 11, 2014
Octocat-spinner-32 LICENSE Update copyright year to 2014 January 27, 2014
Octocat-spinner-32 NEWS Bump version to 4.4.0 February 11, 2014
Octocat-spinner-32 Move away from FactoryGirl to factory_girl in docs January 29, 2014
Octocat-spinner-32 Rakefile Bump versions of ActiveRecord in Appraisal and fix default task June 14, 2013
Octocat-spinner-32 cucumber.yml Fixed issues with some attributes being skipped and added support for… September 15, 2009
Octocat-spinner-32 factory_girl.gemspec add license information to gemspec January 29, 2013

factory_girl Build Status Dependency Status Code Climate

factory_girl is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.

If you want to use factory_girl with Rails, see factory_girl_rails.


You should find the documentation for your version of factory_girl on Rubygems.

See GETTING_STARTED for information on defining and using factories.


gem install factory_girl

or add the following line to Gemfile:

gem 'factory_girl'

and run bundle install from your shell.

Supported Ruby versions

The factory_girl 3.x+ series supports MRI Ruby 1.9. Additionally, factory_girl 3.6+ supports JRuby while running in 1.9 mode. See GETTING_STARTED for more information on configuring the JRuby environment.

For versions of Ruby prior to 1.9, please use factory_girl 2.x.

More Information


Please see the contribution guidelines.


factory_girl was originally written by Joe Ferris and is now maintained by Josh Clayton. Many improvements and bugfixes were contributed by the open source community.


factory_girl is maintained and funded by thoughtbot, inc

The names and logos for thoughtbot are trademarks of thoughtbot, inc.


factory_girl is Copyright © 2008-2014 Joe Ferris and thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.

Something went wrong with that request. Please try again.