aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/request_forgery_protection_test.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2019-08-04 02:53:01 +0200
committerGitHub <noreply@github.com>2019-08-04 02:53:01 +0200
commit5f3848a979e6be15a4d8bedcb9c68587094094fe (patch)
tree8253c1554e5c13a4891c48f628492e8532ced9ca /actionpack/test/controller/request_forgery_protection_test.rb
parentf1f5024b918ecf303b9908f78d1a6136d9418730 (diff)
parent7cf445d3bdc466f26b4a1929822ccd34daac19a7 (diff)
downloadrails-5f3848a979e6be15a4d8bedcb9c68587094094fe.tar.gz
rails-5f3848a979e6be15a4d8bedcb9c68587094094fe.tar.bz2
rails-5f3848a979e6be15a4d8bedcb9c68587094094fe.zip
Merge pull request #36854 from eugeneius/media_type_instead_of_content_type
Use media_type instead of content_type internally
Diffstat (limited to 'actionpack/test/controller/request_forgery_protection_test.rb')
-rw-r--r--actionpack/test/controller/request_forgery_protection_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb
index 01250880f5..145d04f5be 100644
--- a/actionpack/test/controller/request_forgery_protection_test.rb
+++ b/actionpack/test/controller/request_forgery_protection_test.rb
@@ -591,6 +591,15 @@ module RequestForgeryProtectionTests
end
end
+ def test_should_not_trigger_content_type_deprecation
+ original = ActionDispatch::Response.return_only_media_type_on_content_type
+ ActionDispatch::Response.return_only_media_type_on_content_type = true
+
+ assert_not_deprecated { get :same_origin_js, xhr: true }
+ ensure
+ ActionDispatch::Response.return_only_media_type_on_content_type = original
+ end
+
def test_should_not_raise_error_if_token_is_not_a_string
assert_blocked do
patch :index, params: { custom_authenticity_token: { foo: "bar" } }