Content
Bug OP-468: moves_controller_spec: validation of work_packages (->type) fails the test, misses cases
View differences
Updated by Stefan Frank almost 13 years ago
The spec for the work\_package-moves-controller currently only tests the one leg of the move:
<code lang="ruby">
context "with following" do
subject do
post :create,
:work_package_id => work_package.id,
:new_project_id => target_project.id,
:new_type_id => target_project.types.first.id,
:assigned_to_id => '',
:status_id => '',
:start_date => '',
:due_date => '',
:follow => '1'
end
</code>
this tests only, that wp’s with a proper new type are actually moved: We should also test, that wp with the wrong type get rejected (expect redirect to issue-page, corresponding flash-message), proper handling of bulk moves etc.
That probably leads to a whole lotta changes in the moves-controller, so I just postpone this to be able to schedule this properly.
<code lang="ruby">
context "with following" do
subject do
post :create,
:work_package_id => work_package.id,
:new_project_id => target_project.id,
:new_type_id => target_project.types.first.id,
:assigned_to_id => '',
:status_id => '',
:start_date => '',
:due_date => '',
:follow => '1'
end
</code>
this tests only, that wp’s with a proper new type are actually moved: We should also test, that wp with the wrong type get rejected (expect redirect to issue-page, corresponding flash-message), proper handling of bulk moves etc.
That probably leads to a whole lotta changes in the moves-controller, so I just postpone this to be able to schedule this properly.