Make sure we restore I18n.locale when tests complete

This commit is contained in:
Tom Hughes 2014-05-13 19:25:06 +01:00
parent 88ff6496a1
commit b13018cc96
2 changed files with 8 additions and 0 deletions

View 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"

View 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))