diff options
author | Max Melentiev <melentievm@gmail.com> | 2013-10-22 18:14:50 +0400 |
---|---|---|
committer | Max Melentiev <melentievm@gmail.com> | 2013-10-22 18:17:05 +0400 |
commit | fde7344542a76e7f1f95a2265ac5480a1ef9aeed (patch) | |
tree | 6a15a5fd7f393ca112dfc8ec1549641623dcdbac /actionpack/test/abstract | |
parent | 40a8130bc5f00f0d77b152e75484f175d70cabdd (diff) | |
download | rails-fde7344542a76e7f1f95a2265ac5480a1ef9aeed.tar.gz rails-fde7344542a76e7f1f95a2265ac5480a1ef9aeed.tar.bz2 rails-fde7344542a76e7f1f95a2265ac5480a1ef9aeed.zip |
ActionController#translate also lookups shortcut without action name
Diffstat (limited to 'actionpack/test/abstract')
-rw-r--r-- | actionpack/test/abstract/translation_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/test/abstract/translation_test.rb b/actionpack/test/abstract/translation_test.rb index d43a445535..8289252dfc 100644 --- a/actionpack/test/abstract/translation_test.rb +++ b/actionpack/test/abstract/translation_test.rb @@ -19,10 +19,12 @@ module AbstractController index: { foo: 'bar', }, + no_action: 'no_action_tr', }, }, }, }) + @controller.stubs(action_name: :index) end def test_action_controller_base_responds_to_translate @@ -42,15 +44,17 @@ module AbstractController end def test_lazy_lookup - @controller.stubs(action_name: :index) assert_equal 'bar', @controller.t('.foo') end def test_lazy_lookup_with_symbol - @controller.stubs(action_name: :index) assert_equal 'bar', @controller.t(:'.foo') end + def test_lazy_lookup_fallback + assert_equal 'no_action_tr', @controller.t(:'.no_action') + end + def test_default_translation assert_equal 'bar', @controller.t('one.two') end |