summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/unit/issue_test.rb31
1 files changed, 22 insertions, 9 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 2763b2f0e..03cb029f1 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -410,26 +410,39 @@ class IssueTest < ActiveSupport::TestCase
def test_new_statuses_allowed_to
WorkflowTransition.delete_all
-
- WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 2, :author => false, :assignee => false)
- WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3, :author => true, :assignee => false)
- WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4, :author => false, :assignee => true)
- WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5, :author => true, :assignee => true)
+ WorkflowTransition.create!(:role_id => 1, :tracker_id => 1,
+ :old_status_id => 1, :new_status_id => 2,
+ :author => false, :assignee => false)
+ WorkflowTransition.create!(:role_id => 1, :tracker_id => 1,
+ :old_status_id => 1, :new_status_id => 3,
+ :author => true, :assignee => false)
+ WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1,
+ :new_status_id => 4, :author => false,
+ :assignee => true)
+ WorkflowTransition.create!(:role_id => 1, :tracker_id => 1,
+ :old_status_id => 1, :new_status_id => 5,
+ :author => true, :assignee => true)
status = IssueStatus.find(1)
role = Role.find(1)
tracker = Tracker.find(1)
user = User.find(2)
- issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1)
+ issue = Issue.generate!(:tracker => tracker, :status => status,
+ :project_id => 1, :author_id => 1)
assert_equal [1, 2], issue.new_statuses_allowed_to(user).map(&:id)
- issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user)
+ issue = Issue.generate!(:tracker => tracker, :status => status,
+ :project_id => 1, :author => user)
assert_equal [1, 2, 3, 5], issue.new_statuses_allowed_to(user).map(&:id)
- issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1, :assigned_to => user)
+ issue = Issue.generate!(:tracker => tracker, :status => status,
+ :project_id => 1, :author_id => 1,
+ :assigned_to => user)
assert_equal [1, 2, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
- issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user, :assigned_to => user)
+ issue = Issue.generate!(:tracker => tracker, :status => status,
+ :project_id => 1, :author => user,
+ :assigned_to => user)
assert_equal [1, 2, 3, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
end