From 1030b7b2d6ffe55b33ed55c2388702679c282367 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 3 Jan 2013 20:21:18 +0900 Subject: test PATCH method for update action in generated scaffold controller test rather than PUT --- railties/test/generators/scaffold_controller_generator_test.rb | 4 ++-- railties/test/generators/scaffold_generator_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/test/generators') diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb index f13305adb0..217648263a 100644 --- a/railties/test/generators/scaffold_controller_generator_test.rb +++ b/railties/test/generators/scaffold_controller_generator_test.rb @@ -101,7 +101,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase assert_match(/class UsersControllerTest < ActionController::TestCase/, content) assert_match(/test "should get index"/, content) assert_match(/post :create, user: \{ age: @user\.age, name: @user\.name, organization_id: @user\.organization_id, organization_type: @user\.organization_type \}/, content) - assert_match(/put :update, id: @user, user: \{ age: @user\.age, name: @user\.name, organization_id: @user\.organization_id, organization_type: @user\.organization_type \}/, content) + assert_match(/patch :update, id: @user, user: \{ age: @user\.age, name: @user\.name, organization_id: @user\.organization_id, organization_type: @user\.organization_type \}/, content) end end @@ -112,7 +112,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase assert_match(/class UsersControllerTest < ActionController::TestCase/, content) assert_match(/test "should get index"/, content) assert_match(/post :create, user: \{ \}/, content) - assert_match(/put :update, id: @user, user: \{ \}/, content) + assert_match(/patch :update, id: @user, user: \{ \}/, content) end end diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index f3f2c170ee..a8dc50f601 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -61,7 +61,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase assert_file "test/controllers/product_lines_controller_test.rb" do |test| assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, test) assert_match(/post :create, product_line: \{ product_id: @product_line\.product_id, title: @product_line\.title, user_id: @product_line\.user_id \}/, test) - assert_match(/put :update, id: @product_line, product_line: \{ product_id: @product_line\.product_id, title: @product_line\.title, user_id: @product_line\.user_id \}/, test) + assert_match(/patch :update, id: @product_line, product_line: \{ product_id: @product_line\.product_id, title: @product_line\.title, user_id: @product_line\.user_id \}/, test) end # Views @@ -87,7 +87,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, content) assert_match(/test "should get index"/, content) assert_match(/post :create, product_line: \{ \}/, content) - assert_match(/put :update, id: @product_line, product_line: \{ \}/, content) + assert_match(/patch :update, id: @product_line, product_line: \{ \}/, content) end end -- cgit v1.2.3