aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/fixtures/test/scoped_array_translation.erb1
-rw-r--r--actionpack/test/template/translation_helper_test.rb6
2 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/fixtures/test/scoped_array_translation.erb b/actionpack/test/fixtures/test/scoped_array_translation.erb
new file mode 100644
index 0000000000..0a0c79f717
--- /dev/null
+++ b/actionpack/test/fixtures/test/scoped_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 5a32d71409..6782bf06d4 100644
--- a/actionpack/test/template/translation_helper_test.rb
+++ b/actionpack/test/template/translation_helper_test.rb
@@ -41,4 +41,10 @@ class TranslationHelperTest < ActiveSupport::TestCase
@view = ActionView::Base.new(ActionController::Base.view_paths, {})
assert_equal "helper", @view.render(:file => "test/translation")
end
+
+ def test_scoping_by_partial_of_an_array
+ I18n.expects(:translate).with("test.scoped_array_translation.foo.bar", :raise => true).returns(["foo", "bar"])
+ @view = ActionView::Base.new(ActionController::Base.view_paths, {})
+ assert_equal "foobar", @view.render(:file => "test/scoped_array_translation")
+ end
end