diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/localized_templates_test.rb | 22 | ||||
-rw-r--r-- | actionpack/test/fixtures/localized/hello_world.de.html | 1 | ||||
-rw-r--r-- | actionpack/test/fixtures/localized/hello_world.en.html | 1 |
3 files changed, 24 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 diff --git a/actionpack/test/fixtures/localized/hello_world.de.html b/actionpack/test/fixtures/localized/hello_world.de.html new file mode 100644 index 0000000000..4727d7a7e0 --- /dev/null +++ b/actionpack/test/fixtures/localized/hello_world.de.html @@ -0,0 +1 @@ +Gutten Tag
\ No newline at end of file diff --git a/actionpack/test/fixtures/localized/hello_world.en.html b/actionpack/test/fixtures/localized/hello_world.en.html new file mode 100644 index 0000000000..5e1c309dae --- /dev/null +++ b/actionpack/test/fixtures/localized/hello_world.en.html @@ -0,0 +1 @@ +Hello World
\ No newline at end of file |