Created
May 27, 2011 13:50
-
-
Save coffeeaddict/995285 to your computer and use it in GitHub Desktop.
Factories with randomness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rufus-mnemo' | |
Factory.sequence :word do |n| | |
Rufus::Mnemo::from_integer(10000000 + n) | |
end | |
Factory.define :company do |r| | |
r.name { Factory.next :word } | |
end | |
Factory.define :user do |u| | |
u.email { Factory.next(:word) + "@hisdomain.org" } | |
u.password { Factory.next(:word) } | |
u.association :company, :factory => :company | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment