Rails shoulda and factory_girl setup

Posted by kristian nissen on Stack Overflow See other posts from Stack Overflow or by kristian nissen
Published on 2010-06-07T18:45:33Z Indexed on 2010/06/07 19:02 UTC
Read the original article Hit count: 292

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

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby