Skip to content
Collection of useful FactoryGirl sequences.
Find file
New pull request
Failed to load latest commit information.
features use rails 4 for testing
gemfiles updated gemfile lock
lib bump up version
.gitignore initial commit
.travis.yml install appraisal dependencies
.yardopts updated documentation files
Appraisals added sqlite3 and jbuilder (required for travis) update changelog
LICENSE update license's years add int alias, guid alias, fix readme
Rakefile added appraisal for testing purposes
factory_girl_sequences.gemspec added license info

FactoryGirlSequences Build Status Gem Version Dependency Status

Collection of useful FactoryGirl sequences.


This minigem provides only a basic set of standard data. If you need more complex data in your application (e.g. US postal code or address), I recommend Faker.


Add this line to your application's Gemfile:

gem 'factory_girl_sequences', :group => :test

Or install it yourself as:

$ gem install factory_girl_sequences


Name Aliases DataType Example
integer checksum, int Integer 1
string - String string-1
date - Date Sat, 20 Oct 2012
datetime - Time Sat, 20 Oct 2012 16:38:59 MSK +04:00
boolean - Boolean true
uuid guid String 0a4ea40d-e7ed-4fc1-890c-7af86c9c3a07
name login, username, first_name, last_name String name-1
password - String password-1
email - String
port - Integer 1025
ip_address - String
ip_subnet - String
mac_address - String 01:23:45:67:89:01
title - String Title 1
body description, text, content String body-1
slug - String slug-1
url - String
domain - String
subdomain - String blog1
color - String 333333
timestamp - Fixnum 1374582311
token - String JS74sef41ZosXek1ndvY
seat - String 01A


Basic example:

FactoryGirl.generate :email
# => ""

FactoryGirl.generate :email
# => ""

Use them as attributes (preferable way):

factory :user do

Or in lazy attributes:

factory :invite do
  invitee { generate(:email) }

Check out FactoryGirl's GETTING_STARTED for more information.

Spork or TConsole

For whose of you who are using spork or tconsole, consider adding FactoryGirlSequences.reload right after FactoryGirl.reload.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Test your changes by running bundle exec rake cucumber command
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request


Created by Anton Kalyaev

Thank you to all our amazing contributors!


FactoryGirlSequences is Copyright © 2012-2014 Anton Kalyaev. It is free software, and may be redistributed under the terms specified in the MIT License file.

Something went wrong with that request. Please try again.