# FactoryGirlSequences [![Build Status](https://secure.travis-ci.org/akalyaev/factory_girl_sequences.png "Build Status")](http://travis-ci.org/akalyaev/factory_girl_sequences) [![Gem Version](https://badge.fury.io/rb/factory_girl_sequences.png)](http://badge.fury.io/rb/factory_girl_sequences) [![Dependency Status](https://gemnasium.com/akalyaev/factory_girl_sequences.png)](https://gemnasium.com/akalyaev/factory_girl_sequences) Collection of useful [FactoryGirl](http://github.com/thoughtbot/factory_girl) sequences. **Important** 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](http://github.com/stympy/faker). ## Installation Add this line to your application's Gemfile: gem 'factory_girl_sequences', :group => :test Or install it yourself as: $ gem install factory_girl_sequences ## Sequences
Name Aliases DataType Example
integer checksum 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
name login, username, first_name, last_name String name-1
password - String password-1
email - String person1@example.com
port - Integer 1025
ip_address - String 192.168.0.1
ip_subnet - String 192.168.10.0
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 http://example1.com
domain - String example1.com
subdomain - String blog1
color - String 333333
timestamp - Fixnum 1374582311
token - String JS74sef41ZosXek1ndvY
## Usage Basic example: ```ruby FactoryGirl.generate :email # => "person1@example.com" FactoryGirl.generate :email # => "person2@example.com" ``` Use them as attributes (preferable way): ```ruby factory :user do email end ``` Or in lazy attributes: ```ruby factory :invite do invitee { generate(:email) } end ``` Check out FactoryGirl's [GETTING_STARTED](http://github.com/thoughtbot/factory_girl) for more information. ### Spork or tconsole For whose of you who are using spork or tconsole, consider adding `FactoryGirlSequences.reload` right after `FactoryGirl.reload`. ## Contributing 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 ## Credits Created by [Anton Kalyaev](http://github.com/akalyaev) Thank you to all our amazing [contributors](http://github.com/akalyaev/factory_girl_sequences/contributors)! ## License FactoryGirlSequences is Copyright © 2012-2013 Anton Kalyaev. It is free software, and may be redistributed under the terms specified in the [MIT License](http://www.opensource.org/licenses/MIT) file.