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