Rails provides infrastructure for directly testing specific pieces of your application: models, views, controllers, and so on. It also supports tests that integrate multiple layers and acceptance tests that integrate all layers.
The rspec-rails gem adapts the Rails testing infrastructure for use from RSpec. To use it, add an entry like the following one to the :development and :test groups in your Gemfile:
|||group :development, :test do|
|»||gem 'rspec-rails', '~> 3.6'|
Then, run bundle install to install rspec-rails. Finally, you can set your project up to use rspec-rails with the following command:
|||$ rails generate rspec:install|