diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index a772d00..82113df 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -392,10 +392,12 @@ class UserTest < ActiveSupport::TestCase def test_name_format assert_equal 'Smith, John', @jsmith.name(:lastname_coma_firstname) - Setting.user_format = :firstname_lastname - assert_equal 'John Smith', @jsmith.reload.name - Setting.user_format = :username - assert_equal 'jsmith', @jsmith.reload.name + with_settings :user_format => :firstname_lastname do + assert_equal 'John Smith', @jsmith.reload.name + end + with_settings :user_format => :username do + assert_equal 'jsmith', @jsmith.reload.name + end end def test_fields_for_order_statement_should_return_fields_according_user_format_setting