From 6dc5a061f0ed7553ff9b82d4bead93f7e52048d4 Mon Sep 17 00:00:00 2001 From: Alexandru Anca Date: Mon, 27 Apr 2020 20:44:43 -0400 Subject: [PATCH] Remove deprecation warning for Ruby 2.7 Ruby 2.7 has deprecated passing the last argument as a keyword parameter. https://bugs.ruby-lang.org/issues/14183 Fixes the following ``` /rails-controller-testing/lib/rails/controller/testing/template_assertions.rb:61: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /rails/actionpack/lib/action_controller/test_case.rb:460: warning: The called method `process' is defined here ``` The fix is backwards compatible with Ruby < 2.7 --- lib/rails/controller/testing/template_assertions.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rails/controller/testing/template_assertions.rb b/lib/rails/controller/testing/template_assertions.rb index ad5e8ad..3be48d3 100644 --- a/lib/rails/controller/testing/template_assertions.rb +++ b/lib/rails/controller/testing/template_assertions.rb @@ -58,7 +58,9 @@ def teardown_subscriptions def process(*args) reset_template_assertion - super + action = args[0] + params = args[1] || {} + super(action, **params) end def reset_template_assertion