diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-17 09:29:00 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-17 18:07:08 -0200 |
commit | 57be2cfa1eb5cf04c86f4ab5461f6903df099b98 (patch) | |
tree | ed65285b2941850cf0373dc8969111a5bd627c04 /actionpack/test/controller | |
parent | 20baeece919629b7e43b86aebb05f8e2af6d19ef (diff) | |
download | rails-57be2cfa1eb5cf04c86f4ab5461f6903df099b98.tar.gz rails-57be2cfa1eb5cf04c86f4ab5461f6903df099b98.tar.bz2 rails-57be2cfa1eb5cf04c86f4ab5461f6903df099b98.zip |
Deprecate default_charset= at controller level
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/content_type_test.rb | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/actionpack/test/controller/content_type_test.rb b/actionpack/test/controller/content_type_test.rb index d51882066d..d0dabb29ca 100644 --- a/actionpack/test/controller/content_type_test.rb +++ b/actionpack/test/controller/content_type_test.rb @@ -70,12 +70,16 @@ class ContentTypeTest < ActionController::TestCase end def test_render_changed_charset_default - OldContentTypeController.default_charset = "utf-16" - get :render_defaults - assert_equal "utf-16", @response.charset - assert_equal Mime::HTML, @response.content_type - ensure - OldContentTypeController.default_charset = "utf-8" + assert_deprecated /Setting default charset at controller.*config\.action_dispatch\.default_charset/ do + begin + OldContentTypeController.default_charset = "utf-16" + get :render_defaults + assert_equal "utf-16", @response.charset + assert_equal Mime::HTML, @response.content_type + ensure + OldContentTypeController.default_charset = "utf-8" + end + end end # :ported: @@ -107,12 +111,16 @@ class ContentTypeTest < ActionController::TestCase end def test_nil_default_for_erb - OldContentTypeController.default_charset = nil - get :render_default_for_erb - assert_equal Mime::HTML, @response.content_type - assert_nil @response.charset, @response.headers.inspect - ensure - OldContentTypeController.default_charset = "utf-8" + assert_deprecated /Setting default charset at controller.*config\.action_dispatch\.default_charset/ do + begin + OldContentTypeController.default_charset = nil + get :render_default_for_erb + assert_equal Mime::HTML, @response.content_type + assert_nil @response.charset, @response.headers.inspect + ensure + OldContentTypeController.default_charset = "utf-8" + end + end end def test_default_for_erb |