Sunday, December 28, 2008

Creating Fake Data - Adding Multiple User Accounts - Rails


A big testing pain in the ass is adding multiple user accounts and the accompanying profile data (etc.) which provides a more realistic user experience and a wider variation in data to allow for potential issues to crop up more quickly. Thus - hopefully better code.

Well, as with most things Rails, someone (or actually more than one person) has come up with a way to create a bunch of data, populate your databases, and give you a break from manually creating hundreds of accounts. Their projects are below. These tools essentially provide random name, address, number, and other generators (colors, passwords, currency) which you can stack together to create bunches of users.

Forgery
Users dictionaries to generate data. You can override theirs with your own.
http://github.com/sevenwire/forgery/tree/master

Faker
A port of Perl‘s Data::Faker library
http://github.com/yyyc514/faker/tree/master

Populator
Populates an Active Record database with a mass insert, very quickly. This library is quite customizable in terms of the data you can have it create.
http://github.com/ryanb/populator/tree/master

Random-Data
Names, numbers, text, grammar, locations, booleans, arrays. Has a bit more to offer than Forgery.
http://random-data.rubyforge.org/

No comments: