diff .svn/pristine/6d/6d24a0dc5e3b6f9a7f6072591c406a9d6ee664eb.svn-base @ 909:cbb26bc654de redmine-1.3

Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author Chris Cannam
date Fri, 24 Feb 2012 19:09:32 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.svn/pristine/6d/6d24a0dc5e3b6f9a7f6072591c406a9d6ee664eb.svn-base	Fri Feb 24 19:09:32 2012 +0000
@@ -0,0 +1,26 @@
+# Tests in this file ensure that:
+#
+# * translations in the application take precedence over those in plugins
+# * translations in subsequently loaded plugins take precendence over those in previously loaded plugins
+
+require File.dirname(__FILE__) + '/../test_helper'
+
+class LocaleLoadingTest < ActionController::TestCase
+  def setup
+    @request    = ActionController::TestRequest.new
+    @response   = ActionController::TestResponse.new
+  end
+
+  # app takes precedence over plugins
+	
+  def test_WITH_a_translation_defined_in_both_app_and_plugin_IT_should_find_the_one_in_app
+    assert_equal I18n.t('hello'), 'Hello world'
+  end
+	
+  # subsequently loaded plugins take precendence over previously loaded plugins
+	
+  def test_WITH_a_translation_defined_in_two_plugins_IT_should_find_the_latter_of_both
+    assert_equal I18n.t('plugin'), 'beta'
+  end
+end
+