annotate vendor/plugins/engines/test/functional/locale_loading_test.rb @ 8:0c83d98252d9 yuya

* Add custom repo prefix and proper auth realm, remove auth cache (seems like an unwise feature), pass DB handle around, various other bits of tidying
author Chris Cannam
date Thu, 12 Aug 2010 15:31:37 +0100
parents 513646585e45
children
rev   line source
Chris@0 1 # Tests in this file ensure that:
Chris@0 2 #
Chris@0 3 # * translations in the application take precedence over those in plugins
Chris@0 4 # * translations in subsequently loaded plugins take precendence over those in previously loaded plugins
Chris@0 5
Chris@0 6 require File.dirname(__FILE__) + '/../test_helper'
Chris@0 7
Chris@0 8 class LocaleLoadingTest < ActionController::TestCase
Chris@0 9 def setup
Chris@0 10 @request = ActionController::TestRequest.new
Chris@0 11 @response = ActionController::TestResponse.new
Chris@0 12 end
Chris@0 13
Chris@0 14 # app takes precedence over plugins
Chris@0 15
Chris@0 16 def test_WITH_a_translation_defined_in_both_app_and_plugin_IT_should_find_the_one_in_app
Chris@0 17 assert_equal I18n.t('hello'), 'Hello world'
Chris@0 18 end
Chris@0 19
Chris@0 20 # subsequently loaded plugins take precendence over previously loaded plugins
Chris@0 21
Chris@0 22 def test_WITH_a_translation_defined_in_two_plugins_IT_should_find_the_latter_of_both
Chris@0 23 assert_equal I18n.t('plugin'), 'beta'
Chris@0 24 end
Chris@0 25 end
Chris@0 26