From 4ffb1eb39b802ece7f0d4a0c1afb78f7709b4dec Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 16 Mar 2010 16:34:21 -0300 Subject: [PATCH] test case <%= t(['foo', 'bar']) %> it shouldn't be escaped --- .../test/fixtures/test/array_translation.erb | 1 + .../test/template/translation_helper_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 0 deletions(-) create mode 100644 actionpack/test/fixtures/test/array_translation.erb diff --git a/actionpack/test/fixtures/test/array_translation.erb b/actionpack/test/fixtures/test/array_translation.erb new file mode 100644 index 0000000..12c0763 --- /dev/null +++ b/actionpack/test/fixtures/test/array_translation.erb @@ -0,0 +1 @@ +<%= t(['foo', 'bar']) %> \ No newline at end of file diff --git a/actionpack/test/template/translation_helper_test.rb b/actionpack/test/template/translation_helper_test.rb index 699fb2f..428d5ed 100644 --- a/actionpack/test/template/translation_helper_test.rb +++ b/actionpack/test/template/translation_helper_test.rb @@ -23,6 +23,13 @@ class TranslationHelperTest < ActiveSupport::TestCase assert_equal ["foo", "bar"], translate(["foo", "bar"]) end + def test_translation_of_an_array_with_html + expected = 'foobar' + I18n.expects(:translate).with(["foo", "bar"], :raise => true).returns(['foo', 'bar']) + @view = ActionView::Base.new(ActionController::Base.view_paths, {}) + assert_equal expected, @view.render(:file => "test/array_translation") + end + def test_delegates_localize_to_i18n @time = Time.utc(2008, 7, 8, 12, 18, 38) I18n.expects(:localize).with(@time) -- 1.7.0