diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-06-18 06:42:25 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-06-18 06:42:25 +0000 |
commit | 6cd84af522bbc1904d937440a6ad2628cd75fce9 (patch) | |
tree | 21a89eae842660308c7d213cf22617633ac23ab8 /test/unit/tracker_test.rb | |
parent | bbd24fe350a3bdba18eaa3d1a1d9329fd538260d (diff) | |
download | redmine-6cd84af522bbc1904d937440a6ad2628cd75fce9.tar.gz redmine-6cd84af522bbc1904d937440a6ad2628cd75fce9.zip |
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
Diffstat (limited to 'test/unit/tracker_test.rb')
-rw-r--r-- | test/unit/tracker_test.rb | 14 |
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 |