aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/scaffold_controller_generator_test.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-06-07 21:20:05 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2016-06-07 21:20:05 +0200
commit5eea500ecf5858048ec69dbecb70d3f90f2a1024 (patch)
treea4b69a6e87f888dc0a47b71175756f83e3a61b63 /railties/test/generators/scaffold_controller_generator_test.rb
parentf6464ebdbd313d7dac4fd458cf8bb351b790b5db (diff)
parentd68562e3c7ec8061c766ad8d5e189b5f460903c0 (diff)
downloadrails-5eea500ecf5858048ec69dbecb70d3f90f2a1024.tar.gz
rails-5eea500ecf5858048ec69dbecb70d3f90f2a1024.tar.bz2
rails-5eea500ecf5858048ec69dbecb70d3f90f2a1024.zip
Merge pull request #25317 from prathamesh-sonpatki/fix-api-controller-tests
Fix API controller tests by assigning them the encoding type
Diffstat (limited to 'railties/test/generators/scaffold_controller_generator_test.rb')
-rw-r--r--railties/test/generators/scaffold_controller_generator_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb
index c37e289f4b..736ff0b41f 100644
--- a/railties/test/generators/scaffold_controller_generator_test.rb
+++ b/railties/test/generators/scaffold_controller_generator_test.rb
@@ -238,8 +238,8 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
assert_file "test/controllers/users_controller_test.rb" do |content|
assert_match(/class UsersControllerTest < ActionDispatch::IntegrationTest/, content)
assert_match(/test "should get index"/, content)
- assert_match(/post users_url, params: \{ user: \{ age: @user\.age, name: @user\.name, organization_id: @user\.organization_id, organization_type: @user\.organization_type \} \}/, content)
- assert_match(/patch user_url\(@user\), params: \{ user: \{ age: @user\.age, name: @user\.name, organization_id: @user\.organization_id, organization_type: @user\.organization_type \} \}/, content)
+ assert_match(/post users_url, params: \{ user: \{ age: @user\.age, name: @user\.name, organization_id: @user\.organization_id, organization_type: @user\.organization_type \} \}, as: :json/, content)
+ assert_match(/patch user_url\(@user\), params: \{ user: \{ age: @user\.age, name: @user\.name, organization_id: @user\.organization_id, organization_type: @user\.organization_type \} \}, as: :json/, content)
assert_no_match(/assert_redirected_to/, content)
end
end