@@ -51,6 +51,10 class Group < Principal | |||
|
51 | 51 | end |
|
52 | 52 | end |
|
53 | 53 | |
|
54 | def self.human_attribute_name(attribute_key_name, *args) | |
|
55 | attribute_key_name == 'lastname' ? l(:field_name) : super | |
|
56 | end | |
|
57 | ||
|
54 | 58 | private |
|
55 | 59 | |
|
56 | 60 | # Removes references that are not handled by associations |
@@ -33,6 +33,12 class GroupTest < ActiveSupport::TestCase | |||
|
33 | 33 | assert g.save |
|
34 | 34 | end |
|
35 | 35 | |
|
36 | def test_blank_name_error_message | |
|
37 | g = Group.new | |
|
38 | assert !g.save | |
|
39 | assert_include "Name can't be blank", g.errors.full_messages | |
|
40 | end | |
|
41 | ||
|
36 | 42 | def test_roles_given_to_new_user |
|
37 | 43 | group = Group.find(11) |
|
38 | 44 | user = User.find(9) |
General Comments 0
You need to be logged in to leave comments.
Login now