I'm going through a tutorial that has suggested using rspec
, but I have already gone through a lot of default rails installation. I really don't want to have to redo the installation at all. Anyway, when I run
$ rails g integration_test named
I get
invoke test_unit
create test/integration/named_test.rb
When I run bundle
, various rspec
gems are listed, but test_unit
is not. The tutorial seems to have rails invoke rspec
instead of test_unit
without doing anything additional. How do I get rails to use rspec
with the integration test generator command?
What I found that I did that some of the other methods works still is to check my spelling....I had what @tovodeverett had grouping rspec-rails with :development and :test but spelt development incorrectly. That fixed my issue but I was generating tests with test_unit instead of rspec.
In config/application, add this code
In your
config/application.rb
file :Now when you run your generators (example
rails generate scaffold post
), you get rspec test files. Remember to restart your server. For more information on generators see:RailsCasts #216 Generators in Rails 3
If you really want to use the integration_test generator you'll need to specifically modify the command: