From 9ffeb36265928e0fb6de7ffc4b4f3cb3e7fa3581 Mon Sep 17 00:00:00 2001 From: Zuhao Wan Date: Sat, 8 Mar 2014 01:59:57 +0800 Subject: Run ActiveModel test suites in random order. This gets the whole ActiveModel test suites working even if `self.i_suck_and_my_tests_are_order_dependent!` is disabled in `ActiveSupport::TestCase`. Two places are found that potentially leak global state. This patch makes sure states are restored so that none of the changes happen in a single test will be carried over to subsequence tests. --- activemodel/test/cases/translation_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activemodel/test/cases/translation_test.rb') diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb index deb4e1ed0a..cedc812ec7 100644 --- a/activemodel/test/cases/translation_test.rb +++ b/activemodel/test/cases/translation_test.rb @@ -7,6 +7,10 @@ class ActiveModelI18nTests < ActiveModel::TestCase I18n.backend = I18n::Backend::Simple.new end + def teardown + I18n.backend.reload! + end + def test_translated_model_attributes I18n.backend.store_translations 'en', activemodel: { attributes: { person: { name: 'person name attribute' } } } assert_equal 'person name attribute', Person.human_attribute_name('name') -- cgit v1.2.3