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:
Jean-Philippe Lang 2012-02-04 11:14:23 +00:00
parent 55d5e79e5f
commit 6c6519e595
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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)