summaryrefslogtreecommitdiffstats
path: root/test/unit/project_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-05-27 09:12:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-05-27 09:12:42 +0000
commitba37a2c47686770048f66a1af6f4294f4168089b (patch)
treeea366efdfc9ef074e096f7b900b34d61121bc8d5 /test/unit/project_test.rb
parent335a16e4fd28ce464fb45e79fac456b5d6bf88fa (diff)
downloadredmine-ba37a2c47686770048f66a1af6f4294f4168089b.tar.gz
redmine-ba37a2c47686770048f66a1af6f4294f4168089b.zip
Show statuses of project trackers only (#5385).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@16575 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r--test/unit/project_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 66d6fa3b2..24f695831 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -483,6 +483,21 @@ class ProjectTest < ActiveSupport::TestCase
assert_equal [1,2], parent.rolled_up_trackers.collect(&:id)
end
+ def test_rolled_up_statuses
+ project = Project.find(1)
+
+ WorkflowTransition.delete_all
+ WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3)
+ WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
+ WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 2, :new_status_id => 3)
+ WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 3)
+
+ assert_kind_of IssueStatus, project.rolled_up_statuses.first
+ assert_equal IssueStatus.find(1), project.rolled_up_statuses.first
+
+ assert_equal [1, 2, 3, 4], project.rolled_up_statuses.collect(&:id)
+ end
+
test "#rolled_up_trackers should ignore projects with issue_tracking module disabled" do
parent = Project.generate!
parent.trackers = Tracker.find([1, 2])