Using Factory Girl with Rails 3

Posted Posted by Wes in Programming, Ruby, Ruby on Rails     Comments 1 comment
Sep
7

Setting up a new project, I couldn’t get FactoryGirl working. From the README:

If you want to use factory_girl with Rails 3, see http://github.com/thoughtbot/factory_girl_rails

I added this to my Gemfile:

gem 'factory_girl_rails'

A bundle install to install and done.

Note: I’m using rspec2 and putting my factories in spec/factories/*_factory.rb and I’ve seen references to spec/support/factories/*_factory.rb as well. I’m not sure if either is the blessed location.

1 Comment to “Using Factory Girl with Rails 3”

  • Your post has been linked at the Drink Rails blog as one of the useful Ruby on Rails blog posts of the day.

Post comment

about databasically

We live and work in Kansas City, USA.

We're passionate about helping small businesses succeed and want to help you use technology to get more done.

From server, desktop, network management to programming custom web applications in Ruby on Rails, we're here to lend a hand.

Contact us if you have any questions!