Skip to content

Write Rails 5 style tests in your Rails 3 or Rails 4 application.

Notifications You must be signed in to change notification settings

90seconds/rails_test_params_backport

 
 

Repository files navigation

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.

About

Write Rails 5 style tests in your Rails 3 or Rails 4 application.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%