diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-12-04 13:04:23 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-12-04 13:04:23 +0000 |
commit | 62e626e6801e3b4fe9ef55565f4f6065325f608e (patch) | |
tree | 090bae12fac93ffee5edfabcb09471e76c235a80 | |
parent | 6dffb3a5eb182c9ba1d8788ff6893060dd946123 (diff) | |
download | redmine-62e626e6801e3b4fe9ef55565f4f6065325f608e.tar.gz redmine-62e626e6801e3b4fe9ef55565f4f6065325f608e.zip |
code layout clean up test/unit/workflow_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19332 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | test/unit/workflow_test.rb | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/test/unit/workflow_test.rb b/test/unit/workflow_test.rb index 138992d24..3d963e236 100644 --- a/test/unit/workflow_test.rb +++ b/test/unit/workflow_test.rb @@ -28,21 +28,33 @@ class WorkflowTest < ActiveSupport::TestCase def test_copy WorkflowTransition.delete_all - WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 2) - WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 3, :assignee => true) - WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 4, :author => true) + WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, + :old_status_id => 1, :new_status_id => 2) + WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, + :old_status_id => 1, :new_status_id => 3, + :assignee => true) + WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, + :old_status_id => 1, :new_status_id => 4, + :author => true) assert_difference 'WorkflowTransition.count', 3 do WorkflowTransition.copy(Tracker.find(2), Role.find(1), Tracker.find(3), Role.find(2)) end - assert WorkflowTransition.where(:role_id => 2, :tracker_id => 3, :old_status_id => 1, :new_status_id => 2, :author => false, :assignee => false).first - assert WorkflowTransition.where(:role_id => 2, :tracker_id => 3, :old_status_id => 1, :new_status_id => 3, :author => false, :assignee => true).first - assert WorkflowTransition.where(:role_id => 2, :tracker_id => 3, :old_status_id => 1, :new_status_id => 4, :author => true, :assignee => false).first + assert WorkflowTransition.where(:role_id => 2, :tracker_id => 3, + :old_status_id => 1, :new_status_id => 2, + :author => false, :assignee => false).first + assert WorkflowTransition.where(:role_id => 2, :tracker_id => 3, + :old_status_id => 1, :new_status_id => 3, + :author => false, :assignee => true).first + assert WorkflowTransition.where(:role_id => 2, :tracker_id => 3, + :old_status_id => 1, :new_status_id => 4, + :author => true, :assignee => false).first end def test_workflow_permission_should_validate_rule - wp = WorkflowPermission.new(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :field_name => 'due_date') + wp = WorkflowPermission.new(:role_id => 1, :tracker_id => 1, + :old_status_id => 1, :field_name => 'due_date') assert !wp.save wp.rule = 'foo' @@ -56,7 +68,8 @@ class WorkflowTest < ActiveSupport::TestCase end def test_workflow_permission_should_validate_field_name - wp = WorkflowPermission.new(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :rule => 'required') + wp = WorkflowPermission.new(:role_id => 1, :tracker_id => 1, + :old_status_id => 1, :rule => 'required') assert !wp.save wp.field_name = 'foo' |