Repository is archived
No commit activity in last 3 years
No release in over 3 years
Backports the :params, :headers and :env options introduced in Rails 5 to older versions of Rails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
~> 3.4
>= 0

Runtime

< 5.0, >= 3.2.0
< 5.0, >= 3.2.0
 Project Readme

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.