summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-10-13 10:53:05 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-10-13 10:53:05 +0000
commitf76de605a0d02c9c9d62e1e883e596b7ed7d9426 (patch)
tree3e467cfd5b11f3ddbf4d56d7febafd874c441286
parent7a162b725597acca3ba007335c266395beb5e540 (diff)
downloadredmine-f76de605a0d02c9c9d62e1e883e596b7ed7d9426.tar.gz
redmine-f76de605a0d02c9c9d62e1e883e596b7ed7d9426.zip
code layout clean up test_new_statuses_allowed_to of unit issue test
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10643 e93f8b46-1217-0410-a6f0-8f06a7374b81
-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