Chris@0: # Tests in this file ensure that: Chris@0: # Chris@0: # * translations in the application take precedence over those in plugins Chris@0: # * translations in subsequently loaded plugins take precendence over those in previously loaded plugins Chris@0: Chris@0: require File.dirname(__FILE__) + '/../test_helper' Chris@0: Chris@0: class LocaleLoadingTest < ActionController::TestCase Chris@0: def setup Chris@0: @request = ActionController::TestRequest.new Chris@0: @response = ActionController::TestResponse.new Chris@0: end Chris@0: Chris@0: # app takes precedence over plugins Chris@0: Chris@0: def test_WITH_a_translation_defined_in_both_app_and_plugin_IT_should_find_the_one_in_app Chris@0: assert_equal I18n.t('hello'), 'Hello world' Chris@0: end Chris@0: Chris@0: # subsequently loaded plugins take precendence over previously loaded plugins Chris@0: Chris@0: def test_WITH_a_translation_defined_in_two_plugins_IT_should_find_the_latter_of_both Chris@0: assert_equal I18n.t('plugin'), 'beta' Chris@0: end Chris@0: end Chris@0: