summaryrefslogtreecommitdiffstats
path: root/test/unit/project_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-04-22 14:52:58 +0000
committerGo MAEDA <maeda@farend.jp>2020-04-22 14:52:58 +0000
commitf19c291b59ee066fe6a458a8b3bb07e472374da6 (patch)
tree8dbdacf6d8066ddbc6d497851eeaa22d5cdecbbb /test/unit/project_test.rb
parentb90a6a404ffd39e0bc863940839b7c0f613471be (diff)
downloadredmine-f19c291b59ee066fe6a458a8b3bb07e472374da6.tar.gz
redmine-f19c291b59ee066fe6a458a8b3bb07e472374da6.zip
Show groups in members box on project overview page (#33174).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@19718 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r--test/unit/project_test.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 9475e764a..5fc3743d5 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -455,12 +455,16 @@ class ProjectTest < ActiveSupport::TestCase
assert Project.find(3).allowed_parents.include?(nil)
end
- def test_users_by_role
- users_by_role = Project.find(1).users_by_role
- assert_kind_of Hash, users_by_role
+ def test_principals_by_role
+ group = Group.find(10)
+ Member.create!(:principal => group, :project_id => 1, :role_ids => [1])
+
+ principals_by_role = Project.find(1).principals_by_role
+ assert_kind_of Hash, principals_by_role
role = Role.find(1)
- assert_kind_of Array, users_by_role[role]
- assert users_by_role[role].include?(User.find(2))
+ assert_kind_of Array, principals_by_role[role]
+ assert principals_by_role[role].include?(User.find(2))
+ assert principals_by_role[role].include?(group)
end
def test_rolled_up_trackers