:order => %w(firstname lastname id),
:setting_order => 1
},
+ :firstname_lastinitial => {
+ :string => '#{firstname} #{lastname.to_s.chars.first}.',
+ :order => %w(firstname lastname id),
+ :setting_order => 2
+ },
:firstname => {
:string => '#{firstname}',
:order => %w(firstname id),
- :setting_order => 2
+ :setting_order => 3
},
:lastname_firstname => {
:string => '#{lastname} #{firstname}',
:order => %w(lastname firstname id),
- :setting_order => 3
+ :setting_order => 4
},
:lastname_coma_firstname => {
:string => '#{lastname}, #{firstname}',
:order => %w(lastname firstname id),
- :setting_order => 4
+ :setting_order => 5
},
:lastname => {
:string => '#{lastname}',
:order => %w(lastname id),
- :setting_order => 5
+ :setting_order => 6
},
:username => {
:string => '#{login}',
:order => %w(login id),
- :setting_order => 6
+ :setting_order => 7
},
}
end
def test_name_format
+ assert_equal 'John S.', @jsmith.name(:firstname_lastinitial)
assert_equal 'Smith, John', @jsmith.name(:lastname_coma_firstname)
with_settings :user_format => :firstname_lastname do
assert_equal 'John Smith', @jsmith.reload.name