diff options
author | Go MAEDA <maeda@farend.jp> | 2023-04-13 22:59:31 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-04-13 22:59:31 +0000 |
commit | e16a11a22aad8a732d6637365ececfd4d8f5bc12 (patch) | |
tree | a85205aafa18c9c24ed6c4709b86865970ca2679 /test/unit | |
parent | d1e10ee1a9930eee1e4756f2d710c130bcccfa72 (diff) | |
download | redmine-e16a11a22aad8a732d6637365ececfd4d8f5bc12.tar.gz redmine-e16a11a22aad8a732d6637365ececfd4d8f5bc12.zip |
Merged r22180 from trunk to 5.0-stable (#38443).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22181 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/group_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/group_test.rb b/test/unit/group_test.rb index 0ae78e73a..d89a22634 100644 --- a/test/unit/group_test.rb +++ b/test/unit/group_test.rb @@ -177,4 +177,16 @@ class GroupTest < ActiveSupport::TestCase assert_equal %w(A B), Group.sorted.to_a.map(&:name) end + + def test_user_added_should_not_fail_when_group_role_is_empty + group = Group.find(11) + project = Project.first + user = User.find(9) + + m = Member.create!(:principal => group, :project => project, :role_ids => [1]) + MemberRole.where(:member_id => m.id).delete_all + + assert_nothing_raised {group.users << user} + assert group.users.include?(user) + end end |