Browse files

use encoding name since SJIS is Windows-31J on 1.9.3

  • Loading branch information...
1 parent 00da7bc commit 81535fa726f10d4b75ff766ba83ca9299c7db891 @tenderlove tenderlove committed May 13, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 actionpack/test/template/render_test.rb
View
10 actionpack/test/template/render_test.rb
@@ -361,23 +361,25 @@ def test_render_utf8_template_with_default_external_encoding
end
def test_render_utf8_template_with_incompatible_external_encoding
- with_external_encoding Encoding::SJIS do
+ code = Encoding::SJIS
+ with_external_encoding code do
begin
result = @view.render(:file => "test/utf8.html.erb", :layouts => "layouts/yield")
flunk 'Should have raised incompatible encoding error'
rescue ActionView::Template::Error => error
- assert_match 'Your template was not saved as valid Shift_JIS', error.original_exception.message
+ assert_match "Your template was not saved as valid #{code.name}", error.original_exception.message
end
end
end
def test_render_utf8_template_with_partial_with_incompatible_encoding
- with_external_encoding Encoding::SJIS do
+ code = Encoding::SJIS
+ with_external_encoding code do
begin
result = @view.render(:file => "test/utf8_magic_with_bare_partial.html.erb", :layouts => "layouts/yield")
flunk 'Should have raised incompatible encoding error'
rescue ActionView::Template::Error => error
- assert_match 'Your template was not saved as valid Shift_JIS', error.original_exception.message
+ assert_match "Your template was not saved as valid #{code.name}", error.original_exception.message
end
end
end

0 comments on commit 81535fa

Please sign in to comment.