Don't change setting value in tests.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8063 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-12-03 20:28:32 +00:00
parent 937a954013
commit 81bcb4d999
1 changed files with 6 additions and 4 deletions

View File

@ -392,10 +392,12 @@ class UserTest < ActiveSupport::TestCase
def test_name_format def test_name_format
assert_equal 'Smith, John', @jsmith.name(:lastname_coma_firstname) assert_equal 'Smith, John', @jsmith.name(:lastname_coma_firstname)
Setting.user_format = :firstname_lastname with_settings :user_format => :firstname_lastname do
assert_equal 'John Smith', @jsmith.reload.name assert_equal 'John Smith', @jsmith.reload.name
Setting.user_format = :username end
assert_equal 'jsmith', @jsmith.reload.name with_settings :user_format => :username do
assert_equal 'jsmith', @jsmith.reload.name
end
end end
def test_fields_for_order_statement_should_return_fields_according_user_format_setting def test_fields_for_order_statement_should_return_fields_according_user_format_setting