Make sure we restore I18n.locale when tests complete
authorTom Hughes <tom@compton.nu>
Tue, 13 May 2014 18:25:06 +0000 (19:25 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 4 Jul 2014 18:24:25 +0000 (19:24 +0100)
test/helpers/application_helper_test.rb
test/helpers/browse_helper_test.rb

index 46c35f950dee979e34eeb3c0c59a45a7f70ef07d..f9aeb73cc21fe8352d8b04249b9c9e621ce986b6 100644 (file)
@@ -7,6 +7,10 @@ class ApplicationHelperTest < ActionView::TestCase
     I18n.locale = "en"
   end
 
+  def setup
+    I18n.locale = "en"
+  end
+
   def test_linkify
     %w(http://example.com/test ftp://example.com/test https://example.com/test).each do |link|
       text = "Test #{link} is made into a link"
index d5f7a91e6f5fe80f053bd15566624521d100970c..6ca65f7e74b62e2261f9e571f80ee7ebc84e5102 100644 (file)
@@ -12,6 +12,10 @@ class BrowseHelperTest < ActionView::TestCase
     I18n.locale = "en"
   end
 
+  def teardown
+    I18n.locale = "en"
+  end
+
   def test_printable_name
     assert_equal "17", printable_name(current_nodes(:redacted_node))
     assert_equal "<bdi>Test Node</bdi> (<bdi>18</bdi>)", printable_name(current_nodes(:node_with_name))