Fixed: Unrelated error message when creating a group with an invalid name (#9795).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8231 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-12-15 11:13:36 +00:00
parent 08e309ea46
commit 4f5e7d678e
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,10 @@ class Group < Principal
end
end
def self.human_attribute_name(attribute_key_name, *args)
attribute_key_name == 'lastname' ? l(:field_name) : super
end
private
# Removes references that are not handled by associations

View File

@ -33,6 +33,12 @@ class GroupTest < ActiveSupport::TestCase
assert g.save
end
def test_blank_name_error_message
g = Group.new
assert !g.save
assert_include "Name can't be blank", g.errors.full_messages
end
def test_roles_given_to_new_user
group = Group.find(11)
user = User.find(9)