summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-06-18 06:46:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-06-18 06:46:55 +0000
commit26ec2cdc072773f37f2e079361bc6ea92046ee95 (patch)
tree0b5e6ae0821b78d08184a0cc84cb641da621519b /test
parent89cfe130fc0498e66a65e133ac6efdcedc0389be (diff)
downloadredmine-26ec2cdc072773f37f2e079361bc6ea92046ee95.tar.gz
redmine-26ec2cdc072773f37f2e079361bc6ea92046ee95.zip
Merged r15540 (#285).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@15542 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/tracker_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/unit/tracker_test.rb b/test/unit/tracker_test.rb
index 658dbb7f6..d45291fd7 100644
--- a/test/unit/tracker_test.rb
+++ b/test/unit/tracker_test.rb
@@ -18,7 +18,7 @@
require File.expand_path('../../test_helper', __FILE__)
class TrackerTest < ActiveSupport::TestCase
- fixtures :trackers, :workflows, :issue_statuses, :roles, :issues
+ fixtures :trackers, :workflows, :issue_statuses, :roles, :issues, :projects, :projects_trackers
def test_sorted_scope
assert_equal Tracker.all.sort, Tracker.sorted.to_a
@@ -28,6 +28,18 @@ class TrackerTest < ActiveSupport::TestCase
assert_equal Tracker.find_by_name('Feature'), Tracker.named('feature').first
end
+ def test_visible_scope_chained_with_project_rolled_up_trackers
+ project = Project.find(1)
+ role = Role.generate!
+ role.add_permission! :view_issues
+ role.set_permission_trackers :view_issues, [2]
+ role.save!
+ user = User.generate!
+ User.add_to_project user, project, role
+
+ assert_equal [2], project.rolled_up_trackers(false).visible(user).map(&:id)
+ end
+
def test_copy_workflows
source = Tracker.find(1)
rules_count = source.workflow_rules.count