🧐 Common additions and enhancements for Rails testing with RSpec.
Add this line to your application's Gemfile:
gem 'rspec-common'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install rspec-common
In your rails_helper.rb file:
# To include all enhancements
require "rspec/common/all"
or
# To pick and choose which enhancements you would like:
require "rspec/common/shared_examples/controllers"
require "rspec/common/matchers/views/json"
NB: Requiring rspec/common/all
does NOT include fixes for specific Rails
versions.
# To include fixes specific to Rails 7
require "rspec/common/all"
require "rspec/common/rails7_fixes"
Bug reports and pull requests are welcome on GitHub at https://github.com/buildgroundwork/rspec-common.
The gem is available as open source under the terms of the MIT License.