Index: app/controllers/application_controller.rb =================================================================== --- app/controllers/application_controller.rb (revision 17845) +++ app/controllers/application_controller.rb (working copy) @@ -657,9 +657,9 @@ render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator." end - # Renders a 200 response for successful updates or deletions via the API + # Renders a 204 response for successful updates or deletions via the API def render_api_ok - render_api_head :ok + render_api_head :no_content end # Renders a head API response Index: test/integration/api_test/api_test.rb =================================================================== --- test/integration/api_test/api_test.rb (revision 17845) +++ test/integration/api_test/api_test.rb (working copy) @@ -49,7 +49,7 @@ def test_head_response_should_have_empty_body put '/users/7.xml', :params => {:user => {:login => 'foo'}}, :headers => credentials('admin') - assert_response :ok + assert_response :no_content assert_equal '', response.body end end Index: test/integration/api_test/attachments_test.rb =================================================================== --- test/integration/api_test/attachments_test.rb (revision 17845) +++ test/integration/api_test/attachments_test.rb (working copy) @@ -84,7 +84,7 @@ test "DELETE /attachments/:id.xml should return ok and delete Attachment" do assert_difference 'Attachment.count', -1 do delete '/attachments/7.xml', :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', response.body end assert_nil Attachment.find_by_id(7) @@ -93,7 +93,7 @@ test "DELETE /attachments/:id.json should return ok and delete Attachment" do assert_difference 'Attachment.count', -1 do delete '/attachments/7.json', :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', response.body end assert_nil Attachment.find_by_id(7) @@ -104,8 +104,8 @@ :params => {:attachment => {:filename => 'renamed.zip', :description => 'updated'}}, :headers => credentials('jsmith') - assert_response :ok - assert_equal 'application/json', response.content_type + assert_response :no_content + assert_nil response.content_type attachment = Attachment.find(7) assert_equal 'renamed.zip', attachment.filename assert_equal 'updated', attachment.description Index: test/integration/api_test/groups_test.rb =================================================================== --- test/integration/api_test/groups_test.rb (revision 17845) +++ test/integration/api_test/groups_test.rb (working copy) @@ -157,7 +157,7 @@ put "/groups/#{group.id}.xml", :params => {:group => {:name => 'New name', :user_ids => [2, 3]}}, :headers => credentials('admin') - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_equal 'New name', group.reload.name @@ -181,7 +181,7 @@ group = Group.generate! assert_difference 'Group.count', -1 do delete "/groups/#{group.id}.xml", :headers => credentials('admin') - assert_response :ok + assert_response :no_content assert_equal '', @response.body end end @@ -192,7 +192,7 @@ post "/groups/#{group.id}/users.xml", :params => {:user_id => 5}, :headers => credentials('admin') - assert_response :ok + assert_response :no_content assert_equal '', @response.body end assert_include User.find(5), group.reload.users @@ -220,7 +220,7 @@ assert_difference 'group.reload.users.count', -1 do delete "/groups/#{group.id}/users/8.xml", :headers => credentials('admin') - assert_response :ok + assert_response :no_content assert_equal '', @response.body end assert_not_include User.find(8), group.reload.users Index: test/integration/api_test/issue_categories_test.rb =================================================================== --- test/integration/api_test/issue_categories_test.rb (revision 17845) +++ test/integration/api_test/issue_categories_test.rb (working copy) @@ -70,7 +70,7 @@ :params => {:issue_category => {:name => 'API Update'}}, :headers => credentials('jsmith') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_equal 'API Update', IssueCategory.find(2).name end @@ -91,7 +91,7 @@ assert_difference 'IssueCategory.count', -1 do delete '/issue_categories/1.xml', :headers => credentials('jsmith') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_nil IssueCategory.find_by_id(1) end @@ -107,7 +107,7 @@ :headers => credentials('jsmith') end end - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_nil IssueCategory.find_by_id(1) end Index: test/integration/api_test/issue_relations_test.rb =================================================================== --- test/integration/api_test/issue_relations_test.rb (revision 17845) +++ test/integration/api_test/issue_relations_test.rb (working copy) @@ -77,7 +77,7 @@ delete '/relations/2.xml', :headers => credentials('jsmith') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_nil IssueRelation.find_by_id(2) end Index: test/integration/api_test/issues_test.rb =================================================================== --- test/integration/api_test/issues_test.rb (revision 17845) +++ test/integration/api_test/issues_test.rb (working copy) @@ -795,7 +795,7 @@ :params => {:issue => {:subject => 'API update', :notes => 'A new note'}}, :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', response.body end @@ -819,7 +819,7 @@ assert_difference('Issue.count', -1) do delete '/issues/6.xml', :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', response.body end assert_nil Issue.find_by_id(6) @@ -829,7 +829,7 @@ assert_difference('Issue.count', -1) do delete '/issues/6.json', :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', response.body end assert_nil Issue.find_by_id(6) @@ -841,7 +841,7 @@ :params => {:user_id => 3}, :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', response.body end watcher = Watcher.order('id desc').first @@ -855,7 +855,7 @@ assert_difference 'Watcher.count', -1 do delete '/issues/1/watchers/3.xml', :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', response.body end assert_equal false, Issue.find(1).watched_by?(User.find(3)) @@ -972,7 +972,7 @@ :uploads => [{:token => token, :filename => 'test.txt', :content_type => 'text/plain'}]}}, :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', @response.body end Index: test/integration/api_test/memberships_test.rb =================================================================== --- test/integration/api_test/memberships_test.rb (revision 17845) +++ test/integration/api_test/memberships_test.rb (working copy) @@ -135,7 +135,7 @@ :params => {:membership => {:user_id => 3, :role_ids => [1,2]}}, :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', @response.body end member = Member.find(2) @@ -156,7 +156,7 @@ assert_difference 'Member.count', -1 do delete '/memberships/2.xml', :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', @response.body end assert_nil Member.find_by_id(2) Index: test/integration/api_test/projects_test.rb =================================================================== --- test/integration/api_test/projects_test.rb (revision 17845) +++ test/integration/api_test/projects_test.rb (working copy) @@ -198,9 +198,9 @@ :params => {:project => {:name => 'API update'}}, :headers => credentials('jsmith') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body - assert_equal 'application/xml', @response.content_type + assert_nil @response.content_type project = Project.find(2) assert_equal 'API update', project.name end @@ -211,7 +211,7 @@ :params => {:project => {:name => 'API update', :enabled_module_names => ['issue_tracking', 'news', 'time_tracking']}}, :headers => credentials('admin') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body project = Project.find(2) assert_equal ['issue_tracking', 'news', 'time_tracking'], project.enabled_module_names.sort @@ -223,7 +223,7 @@ :params => {:project => {:name => 'API update', :tracker_ids => [1, 3]}}, :headers => credentials('admin') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body project = Project.find(2) assert_equal [1, 3], project.trackers.map(&:id).sort @@ -245,7 +245,7 @@ assert_difference('Project.count',-1) do delete '/projects/2.xml', :headers => credentials('admin') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_nil Project.find_by_id(2) end Index: test/integration/api_test/time_entries_test.rb =================================================================== --- test/integration/api_test/time_entries_test.rb (revision 17845) +++ test/integration/api_test/time_entries_test.rb (working copy) @@ -135,7 +135,7 @@ :params => {:time_entry => {:comments => 'API Update'}}, :headers => credentials('jsmith') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_equal 'API Update', TimeEntry.find(2).comments end @@ -164,7 +164,7 @@ assert_difference 'TimeEntry.count', -1 do delete '/time_entries/2.xml', :headers => credentials('jsmith') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_nil TimeEntry.find_by_id(2) end Index: test/integration/api_test/users_test.rb =================================================================== --- test/integration/api_test/users_test.rb (revision 17845) +++ test/integration/api_test/users_test.rb (working copy) @@ -256,7 +256,7 @@ assert_equal 'jsmith@somenet.foo', user.mail assert !user.admin? - assert_response :ok + assert_response :no_content assert_equal '', @response.body end @@ -279,7 +279,7 @@ assert_equal 'jsmith@somenet.foo', user.mail assert !user.admin? - assert_response :ok + assert_response :no_content assert_equal '', @response.body end @@ -325,7 +325,7 @@ delete '/users/2.xml', :headers => credentials('admin') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body end @@ -334,7 +334,7 @@ delete '/users/2.json', :headers => credentials('admin') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body end end Index: test/integration/api_test/versions_test.rb =================================================================== --- test/integration/api_test/versions_test.rb (revision 17845) +++ test/integration/api_test/versions_test.rb (working copy) @@ -122,7 +122,7 @@ :params => {:version => {:name => 'API update'}}, :headers => credentials('jsmith') - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_equal 'API update', Version.find(2).name end @@ -132,7 +132,7 @@ delete '/versions/3.xml', :headers => credentials('jsmith') end - assert_response :ok + assert_response :no_content assert_equal '', @response.body assert_nil Version.find_by_id(3) end Index: test/integration/api_test/wiki_pages_test.rb =================================================================== --- test/integration/api_test/wiki_pages_test.rb (revision 17845) +++ test/integration/api_test/wiki_pages_test.rb (working copy) @@ -106,7 +106,7 @@ put '/projects/ecookbook/wiki/CookBook_documentation.xml', :params => {:wiki_page => {:text => 'New content from API', :comments => 'API update'}}, :headers => credentials('jsmith') - assert_response 200 + assert_response :no_content end end @@ -123,7 +123,7 @@ put '/projects/ecookbook/wiki/CookBook_documentation.xml', :params => {:wiki_page => {:text => 'New content from API', :comments => 'API update', :version => '3'}}, :headers => credentials('jsmith') - assert_response 200 + assert_response :no_content end end @@ -201,7 +201,7 @@ test "DELETE /projects/:project_id/wiki/:title.xml should destroy the page" do assert_difference 'WikiPage.count', -1 do delete '/projects/ecookbook/wiki/CookBook_documentation.xml', :headers => credentials('jsmith') - assert_response 200 + assert_response :no_content end assert_nil WikiPage.find_by_id(1)