add new user format "lastname" (#10937)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10543 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-10-01 07:08:04 +00:00
parent de0e0f09a3
commit a29854707b
2 changed files with 9 additions and 1 deletions

View File

@ -48,10 +48,15 @@ class User < Principal
:order => %w(lastname firstname id),
:setting_order => 4
},
:lastname => {
:string => '#{lastname}',
:order => %w(lastname id),
:setting_order => 5
},
:username => {
:string => '#{login}',
:order => %w(login id),
:setting_order => 5
:setting_order => 6
},
}

View File

@ -417,6 +417,9 @@ class UserTest < ActiveSupport::TestCase
with_settings :user_format => :username do
assert_equal 'jsmith', @jsmith.reload.name
end
with_settings :user_format => :lastname do
assert_equal 'Smith', @jsmith.reload.name
end
end
def test_today_should_return_the_day_according_to_user_time_zone