summaryrefslogtreecommitdiffstats
path: root/test/unit/project_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-11-09 18:01:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-11-09 18:01:04 +0000
commit151892c3131a22ec7786362d79a207c30851fe5f (patch)
treeb0c485503badba1d7651885405f3dae9f297f4f0 /test/unit/project_test.rb
parentc2fe2d0c0615b01dd61088b5e99e9b3db9eb7529 (diff)
downloadredmine-151892c3131a22ec7786362d79a207c30851fe5f.tar.gz
redmine-151892c3131a22ec7786362d79a207c30851fe5f.zip
Fixed that Project.uniq.visible errors under certain conditions (#21182).
Patch by Redmine CRM. git-svn-id: http://svn.redmine.org/redmine/trunk@14857 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r--test/unit/project_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index ffb514aa3..b6b578a9e 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -991,4 +991,13 @@ class ProjectTest < ActiveSupport::TestCase
p.status = Project::STATUS_CLOSED
assert_include 'closed', p.css_classes.split
end
+
+ def test_combination_of_visible_and_uniq_scopes_in_case_anonymous_group_has_memberships_should_not_error
+ project = Project.find(1)
+ member = Member.create!(:project => project, :principal => Group.anonymous, :roles => [Role.generate!])
+ project.members << member
+ assert_nothing_raised do
+ Project.uniq.visible.to_a
+ end
+ end
end