Merged r8231, r8235, r8236, 8237 from trunk (#9795).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.3-stable@8768 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
55d5e79e5f
commit
6c6519e595
|
@ -51,6 +51,14 @@ class Group < Principal
|
|||
end
|
||||
end
|
||||
|
||||
def self.human_attribute_name(attribute_key_name)
|
||||
attr_name = attribute_key_name
|
||||
if attr_name == 'lastname'
|
||||
attr_name = "name"
|
||||
end
|
||||
super(attr_name)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Removes references that are not handled by associations
|
||||
|
|
|
@ -28,11 +28,29 @@ class GroupTest < ActiveSupport::TestCase
|
|||
:workflows,
|
||||
:groups_users
|
||||
|
||||
include Redmine::I18n
|
||||
|
||||
def test_create
|
||||
g = Group.new(:lastname => 'New group')
|
||||
assert g.save
|
||||
end
|
||||
|
||||
def test_blank_name_error_message
|
||||
set_language_if_valid 'en'
|
||||
g = Group.new
|
||||
assert !g.save
|
||||
assert_include "Name can't be blank", g.errors.full_messages
|
||||
end
|
||||
|
||||
def test_blank_name_error_message_fr
|
||||
set_language_if_valid 'fr'
|
||||
str = "Nom doit \xc3\xaatre renseign\xc3\xa9(e)"
|
||||
str.force_encoding('UTF-8') if str.respond_to?(:force_encoding)
|
||||
g = Group.new
|
||||
assert !g.save
|
||||
assert_include str, g.errors.full_messages
|
||||
end
|
||||
|
||||
def test_roles_given_to_new_user
|
||||
group = Group.find(11)
|
||||
user = User.find(9)
|
||||
|
|
Loading…
Reference in New Issue