From d9be4fc73b284acec5d6732606f74a3f75e7403b Mon Sep 17 00:00:00 2001 From: John Fragoulis Date: Tue, 30 May 2017 16:00:59 +0300 Subject: [PATCH] Specify params explicitely in controller specs https://github.com/rails/rails/pull/18323 --- test/support/helpers.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/support/helpers.rb b/test/support/helpers.rb index 830944b..4e8245c 100644 --- a/test/support/helpers.rb +++ b/test/support/helpers.rb @@ -2,7 +2,13 @@ class ActiveSupport::TestCase def cmd(name, env={}, as="someone") - post "/cogy/cmd/#{name}", env.merge("COG_CHAT_HANDLE" => as) + params = if Rails::VERSION::MAJOR >= 5 + { params: env.merge("COG_CHAT_HANDLE" => as) } + else + env.merge("COG_CHAT_HANDLE" => as) + end + + post "/cogy/cmd/#{name}", params end def fetch_inventory