Commit b838440f15fbc56d0504162fcff376cacf9c8186
1 parent
0f1ca8b3
Exists in
master
and in
4 other branches
Deprecate the DELETE method for Issues API
Now returns HTTP Status 405 - http://httpstatus.es/405 Closes #1245 Closes #1264
Showing
2 changed files
with
4 additions
and
6 deletions
Show diff stats
lib/api/issues.rb
| ... | ... | @@ -95,7 +95,7 @@ module Gitlab |
| 95 | 95 | end |
| 96 | 96 | end |
| 97 | 97 | |
| 98 | - # Delete a project issue | |
| 98 | + # Delete a project issue (deprecated) | |
| 99 | 99 | # |
| 100 | 100 | # Parameters: |
| 101 | 101 | # id (required) - The ID or code name of a project |
| ... | ... | @@ -103,8 +103,7 @@ module Gitlab |
| 103 | 103 | # Example Request: |
| 104 | 104 | # DELETE /projects/:id/issues/:issue_id |
| 105 | 105 | delete ":id/issues/:issue_id" do |
| 106 | - @issue = user_project.issues.find(params[:issue_id]) | |
| 107 | - @issue.destroy | |
| 106 | + error!({'message' => 'method not allowed'}, 405) | |
| 108 | 107 | end |
| 109 | 108 | end |
| 110 | 109 | end | ... | ... |
spec/api/issues_spec.rb
| ... | ... | @@ -63,9 +63,8 @@ describe Gitlab::API do |
| 63 | 63 | |
| 64 | 64 | describe "DELETE /projects/:id/issues/:issue_id" do |
| 65 | 65 | it "should delete a project issue" do |
| 66 | - expect { | |
| 67 | - delete "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}" | |
| 68 | - }.to change { Issue.count }.by(-1) | |
| 66 | + delete "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}" | |
| 67 | + response.status.should == 405 | |
| 69 | 68 | end |
| 70 | 69 | end |
| 71 | 70 | end | ... | ... |