annotate vendor/plugins/engines/test/functional/locale_loading_test.rb @ 929:5f33065ddc4b redmine-1.3

Update to Redmine SVN rev 9414 on 1.3-stable branch
author Chris Cannam
date Wed, 27 Jun 2012 14:54:18 +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