diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-19 13:22:09 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-19 13:22:09 -0500 |
commit | f5ace625fe524938be35ad7d16bc9c29fd08fb96 (patch) | |
tree | 59ab2184fc0eb36e77c90eb2f62768cb4a8daced /actionpack/test/template | |
parent | f1c8f07be8c055fdcfd5b5a08b5781e21f24e428 (diff) | |
download | rails-f5ace625fe524938be35ad7d16bc9c29fd08fb96.tar.gz rails-f5ace625fe524938be35ad7d16bc9c29fd08fb96.tar.bz2 rails-f5ace625fe524938be35ad7d16bc9c29fd08fb96.zip |
Ensure changes to I18n locale get reset during tests
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/render_test.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index c86d5215cd..3c192906ae 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -33,18 +33,14 @@ module RenderTestCases end def test_render_file_with_localization - begin - old_locale = I18n.locale - I18n.locale = :da - assert_equal "Hey verden", @view.render(:file => "test/hello_world") - ensure - I18n.locale = old_locale - end + old_locale, I18n.locale = I18n.locale, :da + assert_equal "Hey verden", @view.render(:file => "test/hello_world") + ensure + I18n.locale = old_locale end def test_render_file_with_dashed_locale - old_locale = I18n.locale - I18n.locale = :"pt-BR" + old_locale, I18n.locale = I18n.locale, :"pt-BR" assert_equal "Ola mundo", @view.render(:file => "test/hello_world") ensure I18n.locale = old_locale |