From 7527cdf79c640eae5db29a6f3f9b955aa50bc29e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 10 Feb 2009 12:57:12 +0100 Subject: Added partial scoping to TranslationHelper#translate, so if you call translate('.foo') from the people/index.html.erb template, you'll actually be calling I18n.translate(people.index.foo) [DHH] --- actionpack/test/template/translation_helper_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/translation_helper_test.rb b/actionpack/test/template/translation_helper_test.rb index 6534df6bbd..a20f3c394c 100644 --- a/actionpack/test/template/translation_helper_test.rb +++ b/actionpack/test/template/translation_helper_test.rb @@ -23,4 +23,10 @@ class TranslationHelperTest < Test::Unit::TestCase I18n.expects(:localize).with(@time) localize @time end + + def test_scoping_by_partial + expects(:template).returns(stub(:path_without_format_and_extension => "people/index")) + I18n.expects(:translate).with("people.index.foo", :locale => 'en', :raise => true) + translate ".foo", :locale => 'en' + end end -- cgit v1.2.3