To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / .svn / pristine / 6d / 6d24a0dc5e3b6f9a7f6072591c406a9d6ee664eb.svn-base @ 1297:0a574315af3e
History | View | Annotate | Download (855 Bytes)
| 1 |
# Tests in this file ensure that: |
|---|---|
| 2 |
# |
| 3 |
# * translations in the application take precedence over those in plugins |
| 4 |
# * translations in subsequently loaded plugins take precendence over those in previously loaded plugins |
| 5 |
|
| 6 |
require File.dirname(__FILE__) + '/../test_helper' |
| 7 |
|
| 8 |
class LocaleLoadingTest < ActionController::TestCase |
| 9 |
def setup |
| 10 |
@request = ActionController::TestRequest.new |
| 11 |
@response = ActionController::TestResponse.new |
| 12 |
end |
| 13 |
|
| 14 |
# app takes precedence over plugins |
| 15 |
|
| 16 |
def test_WITH_a_translation_defined_in_both_app_and_plugin_IT_should_find_the_one_in_app |
| 17 |
assert_equal I18n.t('hello'), 'Hello world'
|
| 18 |
end |
| 19 |
|
| 20 |
# subsequently loaded plugins take precendence over previously loaded plugins |
| 21 |
|
| 22 |
def test_WITH_a_translation_defined_in_two_plugins_IT_should_find_the_latter_of_both |
| 23 |
assert_equal I18n.t('plugin'), 'beta'
|
| 24 |
end |
| 25 |
end |
| 26 |
|