mirror of
https://github.com/redmine/redmine.git
synced 2025-11-13 08:46:01 +01:00
Adds Initials to the list of default gratavar options (#42623).
git-svn-id: https://svn.redmine.org/redmine/trunk@23767 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -589,6 +589,27 @@ class UserTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_initials_format
|
||||
assert_equal 'JS', @jsmith.initials(:firstname_lastinitial)
|
||||
assert_equal 'SJ', @jsmith.initials(:lastname_comma_firstname)
|
||||
assert_equal 'SJ', @jsmith.initials(:lastname_firstname)
|
||||
assert_equal 'JS', @jsmith.initials(:firstinitial_lastname)
|
||||
assert_equal 'JL', User.new(:firstname => 'Jean-Philippe', :lastname => 'Lang').initials(:firstinitial_lastname)
|
||||
assert_equal 'JS', @jsmith.initials(:undefined_format)
|
||||
end
|
||||
|
||||
def test_initials_should_use_setting_as_default_format
|
||||
with_settings :user_format => :firstname_lastname do
|
||||
assert_equal 'JS', @jsmith.reload.initials
|
||||
end
|
||||
with_settings :user_format => :username do
|
||||
assert_equal 'JS', @jsmith.reload.initials
|
||||
end
|
||||
with_settings :user_format => :lastname do
|
||||
assert_equal 'SM', @jsmith.reload.initials
|
||||
end
|
||||
end
|
||||
|
||||
def test_lastname_should_accept_255_characters
|
||||
u = User.first
|
||||
u.lastname = 'a' * 255
|
||||
|
||||
Reference in New Issue
Block a user