aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/translation_test.rb
diff options
context:
space:
mode:
authorZuhao Wan <wanzuhao@gmail.com>2014-03-08 01:59:57 +0800
committerZuhao Wan <wanzuhao@gmail.com>2014-03-10 03:52:51 +0800
commit9ffeb36265928e0fb6de7ffc4b4f3cb3e7fa3581 (patch)
tree45c1d9bdaaf17febc0c42ef611bd75f9b98e7f02 /activemodel/test/cases/translation_test.rb
parent70ff31d69f017d1bc674b913865d5a008de0c8a6 (diff)
downloadrails-9ffeb36265928e0fb6de7ffc4b4f3cb3e7fa3581.tar.gz
rails-9ffeb36265928e0fb6de7ffc4b4f3cb3e7fa3581.tar.bz2
rails-9ffeb36265928e0fb6de7ffc4b4f3cb3e7fa3581.zip
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.
Diffstat (limited to 'activemodel/test/cases/translation_test.rb')
-rw-r--r--activemodel/test/cases/translation_test.rb4
1 files changed, 4 insertions, 0 deletions
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')