Search code examples
ruby-on-rails-3rspecrspec2rspec-rails

rspec generator in rails 3.2.5


I just upgraded to rails 3.2.5 and now when I generate new controllers I don't get rspec tests generated by default.

I can do rails g controller foo -t rspec, but I'd prefer to just do rails g controller foo.

How do I fix that default?


Solution

  • You need to do rails g rspec:install inside your project folder (presuming you have rspec in your gem file/bundle). That will activate the generators for you.

    Mark of Mark's Blog has an excellent article on it here.