Wednesday, October 23, 2013

group :development, :test do
gem 'rspec-rails', '2.11.0'
gem 'shoulda-matchers'
end
# Add PostgreSQL for production (optional).
group :production do
gem 'pg', '0.12.2'
end

3) Include the Capybara gem, which allows us to simulate a user's interaction with the sample application using a natural English-like syntax.

group :test do
gem 'capybara', '1.1.2'
end

4) Install the gems with "--without production" option. This is a remembered option, which means that we don't have to include it in future invocations of Bundler. Instead, we can write simply bundle install and production gems will be ignored automatically.

$ bundle install --without production

5) Configure Rails to use RSpec (Note the single colon ":").

$ rails generate rspec:install

Note: Add --format doc in .rspec file to make the test output hierarchical