By default, only show statuses that are used by the tracker on the workflow edit view.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3188 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-12-18 15:41:32 +00:00
parent 6a369f28dd
commit 6bf0723d06
40 changed files with 114 additions and 9 deletions

View File

@@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper'
class TrackerTest < ActiveSupport::TestCase
fixtures :trackers, :workflows
fixtures :trackers, :workflows, :issue_statuses, :roles
def test_copy_workflows
source = Tracker.find(1)
@@ -30,4 +30,20 @@ class TrackerTest < ActiveSupport::TestCase
target.reload
assert_equal 89, target.workflows.size
end
def test_issue_statuses
tracker = Tracker.find(1)
Workflow.delete_all
Workflow.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 2, :new_status_id => 3)
Workflow.create!(:role_id => 2, :tracker_id => 1, :old_status_id => 3, :new_status_id => 5)
assert_kind_of Array, tracker.issue_statuses
assert_kind_of IssueStatus, tracker.issue_statuses.first
assert_equal [2, 3, 5], Tracker.find(1).issue_statuses.collect(&:id)
end
def test_issue_statuses_empty
Workflow.delete_all("tracker_id = 1")
assert_equal [], Tracker.find(1).issue_statuses
end
end