Rails shoulda and factory_girl setup
- by kristian nissen
I have installed both shoulda and factory_girl, I can run shoulda just fine, but when I add this:
require 'factory_girl'
Factory.define :user do |u|
u.mail '[email protected]'
u.pass 'secret'
end
to my test/test_helper.rb I'm getting this error:
/test/test_helper.rb:1:in `require': no such file to load -- factory_girl (LoadError)
when I execute rake test:units
I have installed both gems using:
sudo gem install thoughtbot-shoulda --source=http://gems.github.com
sudo gem install thoughtbot-factory_girl --source=http://gems.github.com
and can see both of them being installed fine.
And by the way, this works fine as well:
script/console
Loading development environment (Rails 2.3.8)
require 'factory_girl'
= []
so requiring the gems seems to be working