mdarby / sweatshop
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Sun Oct 19 20:13:12 -0700 2008 | |
| |
README.textile | Mon Oct 20 05:55:09 -0700 2008 | |
| |
Rakefile | Sun Oct 19 20:13:12 -0700 2008 | |
| |
init.rb | Sun Oct 19 20:18:10 -0700 2008 | |
| |
install.rb | Sun Oct 19 20:13:12 -0700 2008 | |
| |
lib/ | Sun Oct 19 20:13:12 -0700 2008 | |
| |
tasks/ | Wed Dec 23 06:03:50 -0800 2009 | |
| |
test/ | Sun Oct 19 20:13:12 -0700 2008 | |
| |
uninstall.rb | Sun Oct 19 20:13:12 -0700 2008 |
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
