This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | ||
| |
README.textile | ||
| |
Rakefile | ||
| |
init.rb | ||
| |
install.rb | ||
| |
lib/ | ||
| |
tasks/ | ||
| |
test/ | ||
| |
uninstall.rb |
README.textile
Sweatshop
A Rails plugin that generates factory_girl Factories for all of your ActiveRecord models.
Requirements
You should probably have the factory_girl gem installed
How to Install & Use
- Install the factory_girl gem
gem install factory_girl
- Install the plugin
./script/plugin install git://github.com/mdarby/sweatshop.git
- Run the following rake task to generate your Factories
rake sweatshop:generate
- Make sure you put the two following lines into spec/spec_helper.rb:
require 'factory_girl' Dir.glob("#{RAILS_ROOT}/spec/factories/*.rb").each{|factory| require factory}
- Your Factories will now be automatically included whenever you run your specs.
That’s it!
Notes
I use RSpec for my BDD habit; you might use something else. Those two lines I mention above can be used in Test::Unit, I’m sure. However, it’s up to you to figure out ;)
About the Author
My name is Matt Darby. I’m a 29 year old professional Web Developer and IT Manager. I am the IT Manager and Lead Web Developer at Dynamix Engineering and recently earned a Master’s Degree in Computer Science from Franklin University in Columbus, OH.
Feel free to check out my blog or to recommend me








