From 670ac7312664a61f6125758531659e0238aa455b Mon Sep 17 00:00:00 2001
From: Yves Senn <yves.senn@gmail.com>
Date: Fri, 30 Jan 2015 12:31:44 +0100
Subject: scaffold controller_test template should use kwargs. refs #18323.

This prevents a flood of warnings when generating a new scaffold.
---
 .../generators/test_unit/scaffold/templates/functional_test.rb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'railties/lib/rails')

diff --git a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
index 18bd1ece9d..8d825ae7b0 100644
--- a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
+++ b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
@@ -19,30 +19,30 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
 
   test "should create <%= singular_table_name %>" do
     assert_difference('<%= class_name %>.count') do
-      post :create, <%= "#{singular_table_name}: { #{attributes_hash} }" %>
+      post :create, params: { <%= "#{singular_table_name}: { #{attributes_hash} }" %> }
     end
 
     assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>))
   end
 
   test "should show <%= singular_table_name %>" do
-    get :show, id: <%= "@#{singular_table_name}" %>
+    get :show, params: { id: <%= "@#{singular_table_name}" %> }
     assert_response :success
   end
 
   test "should get edit" do
-    get :edit, id: <%= "@#{singular_table_name}" %>
+    get :edit, params: { id: <%= "@#{singular_table_name}" %> }
     assert_response :success
   end
 
   test "should update <%= singular_table_name %>" do
-    patch :update, id: <%= "@#{singular_table_name}" %>, <%= "#{singular_table_name}: { #{attributes_hash} }" %>
+    patch :update, params: { id: <%= "@#{singular_table_name}" %>, <%= "#{singular_table_name}: { #{attributes_hash} }" %> }
     assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>))
   end
 
   test "should destroy <%= singular_table_name %>" do
     assert_difference('<%= class_name %>.count', -1) do
-      delete :destroy, id: <%= "@#{singular_table_name}" %>
+      delete :destroy, params: { id: <%= "@#{singular_table_name}" %> }
     end
 
     assert_redirected_to <%= index_helper %>_path
-- 
cgit v1.2.3