Merge pull request #738 from opf/fix/api_cannot_set_planning_element_status_3229

pull/743/head
Hagen Schink 11 years ago
commit 577552bc10
  1. 2
      app/models/permitted_params.rb
  2. 1
      doc/CHANGELOG.md
  3. 26
      spec/controllers/api/v2/planning_elements_controller_spec.rb

@ -275,8 +275,8 @@ class PermittedParams < Struct.new(:params, :user)
:due_date,
:note,
:type_id,
:status_id,
:planning_element_status_comment,
:planning_element_status_id,
:parent_id,
:responsible_id,
:custom_fields => [ #json

@ -32,6 +32,7 @@ See doc/COPYRIGHT.rdoc for more details.
* `#2399` Fix: Translation missing (en and de) for not_a_valid_parent
* `#3054` Fix: Some Projects cannot be deleted
* `#3234` Fix: [Work package tracking] Sorting of work package statuses does not work
* `#3229` Fix: Can't set planning element status
* `#3266` Fix: [Work package tracking] % done in work package status cannot be modified
* `#3291` Fix: Internal error when clicking on member
* `#3303` Fix: [Work package tracking] Search results are linked to wrong location

@ -610,6 +610,32 @@ describe Api::V2::PlanningElementsController do
custom_value.value.should == "Wurst"
end
end
##
# It should be possible to update a planning element's status by transmitting the
# field 'status_id'. The test tries to change a planning element's status from
# status A to B.
describe "status" do
let(:status_a) { FactoryGirl.create :status }
let(:status_b) { FactoryGirl.create :status }
let(:planning_element) { FactoryGirl.create :work_package, :status => status_a }
it 'is updated' do
WorkPackage.find(planning_element.id).status.should == status_a
put 'update',
:project_id => project.identifier,
:format => 'xml',
:id => planning_element.id,
:planning_element => {
:status_id => status_b.id
}
response.response_code.should == 204
WorkPackage.find(planning_element.id).status.should == status_b
end
end
end
describe 'destroy.xml' do

Loading…
Cancel
Save