From f76de605a0d02c9c9d62e1e883e596b7ed7d9426 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 13 Oct 2012 10:53:05 +0000 Subject: [PATCH] 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 --- test/unit/issue_test.rb | 31 ++++++++++++++++++++++--------- 1 file 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