Ruby on Rails: Switch from test_unit to rspec

In your config/application.rb file :

config.generators do |g|
  g.test_framework :rspec
end

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:

rails g integration_test named --integration-tool=rspec

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)