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'
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'