diff options
author | Eugene Kenny <elkenny@gmail.com> | 2019-08-04 00:35:49 +0100 |
---|---|---|
committer | Eugene Kenny <elkenny@gmail.com> | 2019-08-04 00:35:49 +0100 |
commit | 7cf445d3bdc466f26b4a1929822ccd34daac19a7 (patch) | |
tree | c8c695361466cb001623a001e8f247ce35e8ce50 /actionpack/test/controller/render_xml_test.rb | |
parent | 6db2c426c0156dd3738673a676261693cfe92a8d (diff) | |
download | rails-7cf445d3bdc466f26b4a1929822ccd34daac19a7.tar.gz rails-7cf445d3bdc466f26b4a1929822ccd34daac19a7.tar.bz2 rails-7cf445d3bdc466f26b4a1929822ccd34daac19a7.zip |
Use media_type instead of content_type internally
These calls to `content_type` were triggering the deprecation from
c631e8d011a7cf3e7ade4e9e8db56d2b89bd530c in upgraded applications.
We can use `media_type` in all of these cases to avoid the deprecation.
Diffstat (limited to 'actionpack/test/controller/render_xml_test.rb')
-rw-r--r-- | actionpack/test/controller/render_xml_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_xml_test.rb b/actionpack/test/controller/render_xml_test.rb index 28d8e281ab..16da41e7c7 100644 --- a/actionpack/test/controller/render_xml_test.rb +++ b/actionpack/test/controller/render_xml_test.rb @@ -98,4 +98,13 @@ class RenderXmlTest < ActionController::TestCase get :implicit_content_type, format: "atom" assert_equal Mime[:atom], @response.media_type 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 :render_with_to_xml } + ensure + ActionDispatch::Response.return_only_media_type_on_content_type = original + end end |