diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/template_test.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb index 36fc9ccf91..c7c33af670 100644 --- a/actionpack/test/template/template_test.rb +++ b/actionpack/test/template/template_test.rb @@ -83,12 +83,11 @@ class TestERBTemplate < ActiveSupport::TestCase # is set to something other than UTF-8, we don't # get any errors and get back a UTF-8 String. def test_default_external_works - Encoding.default_external = "ISO-8859-1" - @template = new_template("hello \xFCmlat") - assert_equal Encoding::UTF_8, render.encoding - assert_equal "hello \u{fc}mlat", render - ensure - Encoding.default_external = "UTF-8" + with_external_encoding "ISO-8859-1" do + @template = new_template("hello \xFCmlat") + assert_equal Encoding::UTF_8, render.encoding + assert_equal "hello \u{fc}mlat", render + end end def test_encoding_can_be_specified_with_magic_comment |