diff test/test_helper.rb @ 1494:e248c7af89ec redmine-2.4

Update to Redmine SVN revision 12979 on 2.4-stable branch
author Chris Cannam
date Mon, 17 Mar 2014 08:54:02 +0000
parents 261b3d9a4903
children dffacf8a6908
line wrap: on
line diff
--- a/test/test_helper.rb	Tue Jan 14 14:37:42 2014 +0000
+++ b/test/test_helper.rb	Mon Mar 17 08:54:02 2014 +0000
@@ -1,5 +1,5 @@
 # Redmine - project management software
-# Copyright (C) 2006-2013  Jean-Philippe Lang
+# Copyright (C) 2006-2014  Jean-Philippe Lang
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -111,6 +111,14 @@
     User.current = saved_user
   end
 
+  def with_locale(locale, &block)
+    saved_localed = ::I18n.locale
+    ::I18n.locale = locale
+    yield
+  ensure
+    ::I18n.locale = saved_localed
+  end
+
   def change_user_password(login, new_password)
     user = User.where(:login => login).first
     user.password, user.password_confirmation = new_password, new_password