Permalink
Browse files

Clean up I18n stored translations after test.

  • Loading branch information...
1 parent 0c58eb0 commit 48d118573d3a3b7fd5ba8c4fa02dc2f282a93b0e @zuhao zuhao committed Jun 14, 2014
@@ -10,8 +10,11 @@ def form_for(*)
@output_buffer = super
end
- def setup
- super
+ teardown do
+ I18n.backend.reload!
+ end
+
+ setup do
# Create "label" locale for testing I18n label helpers
I18n.backend.store_translations 'label', {
@@ -12,7 +12,6 @@ def setup_view(paths)
@controller_view = TestController.new.view_context
# Reload and register danish language for testing
- I18n.reload!
I18n.backend.store_translations 'da', {}
I18n.backend.store_translations 'pt-BR', {}
@@ -513,6 +512,7 @@ def setup
def teardown
GC.start
+ I18n.reload!
end
end
@@ -530,6 +530,7 @@ def setup
def teardown
GC.start
+ I18n.reload!
end
def test_render_utf8_template_with_magic_comment
@@ -6,7 +6,7 @@ class TranslationHelperTest < ActiveSupport::TestCase
attr_reader :request, :view
- def setup
+ setup do
I18n.backend.store_translations(:en,
:translations => {
:templates => {
@@ -30,6 +30,10 @@ def setup
@view = ::ActionView::Base.new(ActionController::Base.view_paths, {})
end
+ teardown do
+ I18n.backend.reload!
+ end
+
def test_delegates_to_i18n_setting_the_rescue_format_option_to_html
I18n.expects(:translate).with(:foo, :locale => 'en', :raise=>true).returns("")
translate :foo, :locale => 'en'

0 comments on commit 48d1185

Please sign in to comment.