diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-18 15:41:32 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-18 15:41:32 +0000 |
commit | 6bf0723d0654e58bc6c8fc19759ff8fb6502a18f (patch) | |
tree | a90c2bb695ca772be91cab3fb07d79f7ea2de30d /test/unit/tracker_test.rb | |
parent | 6a369f28ddab41673f51c1b7a640ad6054d8e258 (diff) | |
download | redmine-6bf0723d0654e58bc6c8fc19759ff8fb6502a18f.tar.gz redmine-6bf0723d0654e58bc6c8fc19759ff8fb6502a18f.zip |
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
Diffstat (limited to 'test/unit/tracker_test.rb')
-rw-r--r-- | test/unit/tracker_test.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/unit/tracker_test.rb b/test/unit/tracker_test.rb index efc2aa7ed..f27550aa6 100644 --- a/test/unit/tracker_test.rb +++ b/test/unit/tracker_test.rb @@ -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 |