Fixes specs

pull/294/head
Hagen Schink 11 years ago
parent 7c84f7be41
commit 4ae7335f57
  1. 16
      app/models/work_package.rb
  2. 7
      features/planning_elements/planning_element_management.feature
  3. 10
      features/work_packages/moves/work_package_moves_new_copy.feature

@ -396,6 +396,14 @@ class WorkPackage < ActiveRecord::Base
.sum("#{TimeEntry.table_name}.hours").to_f || 0.0
end
# Moves/copies an work_package to a new project and type
# Returns the moved/copied work_package on success, false on failure
def move_to_project(*args)
ret = WorkPackage.transaction do
move_to_project_without_transaction(*args) || raise(ActiveRecord::Rollback)
end || false
end
protected
def recalculate_attributes_for(work_package_id)
@ -505,14 +513,6 @@ class WorkPackage < ActiveRecord::Base
projects
end
# Moves/copies an work_package to a new project and type
# Returns the moved/copied work_package on success, false on failure
def move_to_project(*args)
ret = WorkPackage.transaction do
move_to_project_without_transaction(*args) || raise(ActiveRecord::Rollback)
end || false
end
def move_to_project_without_transaction(new_project, new_type = nil, options = {})
options ||= {}
work_package = options[:copy] ? self.class.new.copy_from(self) : self

@ -40,6 +40,13 @@ Feature: Planning Element Management
And there is a project named "ecookbook" of type "Standard Project"
And I am working in project "ecookbook"
And there is a default issuepriority with:
| name | Normal |
And there is a issuepriority with:
| name | High |
And there is a issuepriority with:
| name | Immediate |
And the project uses the following modules:
| timelines |

@ -62,17 +62,17 @@ Feature: Copying a work package
| issue2 | Bug |
And there are the following planning elements in project "project_1":
| subject | start_date | due_date | planning_element_type |
| pe1 | 2013-01-01 | 2013-12-31 | Bug |
| pe2 | 2013-01-01 | 2013-12-31 | Bug |
| subject | start_date | due_date | type |
| pe1 | 2013-01-01 | 2013-12-31 | Bug |
| pe2 | 2013-01-01 | 2013-12-31 | Bug |
And there are the following issues in project "project_2":
| subject | type |
| issue3 | Feature |
And there are the following planning elements in project "project_2":
| subject | planning_element_type |
| pe3 | Feature |
| subject | type |
| pe3 | Feature |
And the work package "issue1" has the following children:
| issue2 |

Loading…
Cancel
Save