Skip to content

Instantly share code, notes, and snippets.

@ramses-lopez
ramses-lopez / controller_actions_keyword_args.rb
Created October 2, 2020 18:03 — forked from kuahyeow/controller_actions_keyword_args.rb
a rewriter to upgrade to Rails 5.1 style controller test actions
=begin
USAGE: ruby-rewrite -l controller_actions_keyword_args.rb -m <FILE>
This rewriter moves your Rails controller tests from `get action, params, session, flash` to
`get action, params: params, session: session, flash: flash`.
Which is needed if you see the following message in your Rails 5.0 tests :
DEPRECATION WARNING: Using positional arguments in functional tests has been deprecated,
in favor of keyword arguments, and will be removed in Rails 5.1.