aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2009-02-10 12:57:12 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2009-02-10 12:57:12 +0100
commit7527cdf79c640eae5db29a6f3f9b955aa50bc29e (patch)
tree7b3f90e160fe4c53373201c716152f2686f0c7eb /actionpack/test/template
parent3c6bf82115e184f9c819e5797d3822b6b9daeb14 (diff)
downloadrails-7527cdf79c640eae5db29a6f3f9b955aa50bc29e.tar.gz
rails-7527cdf79c640eae5db29a6f3f9b955aa50bc29e.tar.bz2
rails-7527cdf79c640eae5db29a6f3f9b955aa50bc29e.zip
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]
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/translation_helper_test.rb6
1 files changed, 6 insertions, 0 deletions
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