aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/validations_i18n_test.rb
diff options
context:
space:
mode:
authorSven Fuchs <svenfuchs@artweb-design.de>2008-09-15 10:26:50 +0200
committerPratik Naik <pratiknaik@gmail.com>2008-09-20 19:26:16 +0100
commita3b7fa78bfdc33e45e39c095b67e02d50a2c7bea (patch)
tree0de20fad9f3a7ce2e49d660d1243b5b02a32e290 /activerecord/test/cases/validations_i18n_test.rb
parent8cb7d460439a9b20a80a77b6370c1107233d1cbd (diff)
downloadrails-a3b7fa78bfdc33e45e39c095b67e02d50a2c7bea.tar.gz
rails-a3b7fa78bfdc33e45e39c095b67e02d50a2c7bea.tar.bz2
rails-a3b7fa78bfdc33e45e39c095b67e02d50a2c7bea.zip
I18n: Introduce I18n.load_path in favor of I18n.load_translations and change Simple backend to load translations lazily. [#1048 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/cases/validations_i18n_test.rb')
-rw-r--r--activerecord/test/cases/validations_i18n_test.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/cases/validations_i18n_test.rb b/activerecord/test/cases/validations_i18n_test.rb
index e34890ef19..42246f18b6 100644
--- a/activerecord/test/cases/validations_i18n_test.rb
+++ b/activerecord/test/cases/validations_i18n_test.rb
@@ -6,12 +6,16 @@ class ActiveRecordValidationsI18nTests < Test::Unit::TestCase
def setup
reset_callbacks Topic
@topic = Topic.new
+ @old_load_path, @old_backend = I18n.load_path, I18n.backend
+ I18n.load_path.clear
+ I18n.backend = I18n::Backend::Simple.new
I18n.backend.store_translations('en-US', :activerecord => {:errors => {:messages => {:custom => nil}}})
end
def teardown
reset_callbacks Topic
- I18n.load_translations File.dirname(__FILE__) + '/../../lib/active_record/locale/en-US.yml'
+ I18n.load_path.replace @old_load_path
+ I18n.backend = @old_backend
end
def unique_topic