From 6cd84af522bbc1904d937440a6ad2628cd75fce9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 18 Jun 2016 06:42:25 +0000 Subject: Limits the tracker list in filters and issue counts (#285). git-svn-id: http://svn.redmine.org/redmine/trunk@15540 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/tracker_test.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test/unit/tracker_test.rb') 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 -- cgit v1.2.3