diff options
author | Carl Lerche <carllerche@mac.com> | 2010-04-08 18:11:26 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-04-08 18:11:26 -0700 |
commit | 99d54599215c2a8cea7e57f609e8e578043d71b2 (patch) | |
tree | ad6dd5ac7a65525f3b372d52194b50d035ce1579 /actionpack/test/controller | |
parent | 1e3dce08e11bd11e7d774512ea599166c4c45378 (diff) | |
download | rails-99d54599215c2a8cea7e57f609e8e578043d71b2.tar.gz rails-99d54599215c2a8cea7e57f609e8e578043d71b2.tar.bz2 rails-99d54599215c2a8cea7e57f609e8e578043d71b2.zip |
Fixed that default locale templates should be used if the current locale template is missing [DHH]
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/localized_templates_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/test/controller/localized_templates_test.rb b/actionpack/test/controller/localized_templates_test.rb new file mode 100644 index 0000000000..41ff2f3809 --- /dev/null +++ b/actionpack/test/controller/localized_templates_test.rb @@ -0,0 +1,22 @@ +require 'abstract_unit' + +class LocalizedController < ActionController::Base + def hello_world + end +end + +class LocalizedTemplatesTest < ActionController::TestCase + tests LocalizedController + + def test_localized_template_is_used + I18n.locale = :de + get :hello_world + assert_equal "Gutten Tag", @response.body + end + + def test_default_locale_template_is_used_when_locale_is_missing + I18n.locale = :dk + get :hello_world + assert_equal "Hello World", @response.body + end +end
\ No newline at end of file |