Write Rails 5 style tests in your Rails 3 or Rails 4 application.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gemfiles
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
README.md
Rakefile
rails_test_params_backport.gemspec

README.md

RailsTestParamsBackport

Backports the :params, :headers and :env options introduced in Rails 5 to older versions of Rails.

Installation

Add this line to your application's Gemfile:

gem 'rails_test_params_backport'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rails_test_params_backport

Usage

In your test helper, add this line:

require 'rails_test_params_backport'

You can now rewrite your controller and integration tests from using

get :index, id: 1

to

get :index, params: { id: 1 }

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/zendesk/rails_test_params_backport.