-
Notifications
You must be signed in to change notification settings - Fork 119
Forgery(:basic)
krainboltgreene edited this page Jul 21, 2011
·
2 revisions
Returns either true
or false
, randomly.
Forgery(:basic).boolean
#=> true
Forgery(:basic).boolean
#=> false
Randomly generates the name of a color, with the first character uppercase, as a string.
Forgery(:basic).color
#=> "Violet"
Derives the list of colors from dictionaries[:colors]
.
Creates a SHA1 hexdigest, with the current time as a salt. It takes two arguments:
- A string (default:
"password"
) - Any object, should be something that has a meaningful return to
.to_s
, (default:Time.now.to_s
)
Forgery(:basic).encrypt
#=> "b2fbd3955a36068e93e0b9db45bcb178f08336f5"
Forgery(:basic).encrypt 'random-string'
#=> "00932bafce4a9391f888ca77f81f98b8e89d3aa6"
Forgery(:basic).encrypt 'random-string', Time.utc(2009)
#=> "4b157c2fbf430b962842d21926eaa887c3a12f81"
Lorem
Lorem
Lorem
Lorem
Lorem
Lorem