instiki/vendor/rails/actionpack/test/controller/localized_templates_test.rb

24 lines
525 B
Ruby
Raw Normal View History

2010-05-25 19:45:45 +02:00
require 'abstract_unit'
class LocalizedController < ActionController::Base
def hello_world
end
end
class LocalizedTemplatesTest < ActionController::TestCase
tests LocalizedController
teardown { I18n.locale = :en }
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