Commit b838440f authored by Robert Speicher's avatar Robert Speicher

Deprecate the DELETE method for Issues API

Now returns HTTP Status 405 - http://httpstatus.es/405

Closes #1245
Closes #1264
parent 0f1ca8b3
...@@ -95,7 +95,7 @@ module Gitlab ...@@ -95,7 +95,7 @@ module Gitlab
end end
end end
# Delete a project issue # Delete a project issue (deprecated)
# #
# Parameters: # Parameters:
# id (required) - The ID or code name of a project # id (required) - The ID or code name of a project
...@@ -103,8 +103,7 @@ module Gitlab ...@@ -103,8 +103,7 @@ module Gitlab
# Example Request: # Example Request:
# DELETE /projects/:id/issues/:issue_id # DELETE /projects/:id/issues/:issue_id
delete ":id/issues/:issue_id" do delete ":id/issues/:issue_id" do
@issue = user_project.issues.find(params[:issue_id]) error!({'message' => 'method not allowed'}, 405)
@issue.destroy
end end
end end
end end
......
...@@ -63,9 +63,8 @@ describe Gitlab::API do ...@@ -63,9 +63,8 @@ describe Gitlab::API do
describe "DELETE /projects/:id/issues/:issue_id" do describe "DELETE /projects/:id/issues/:issue_id" do
it "should delete a project issue" do it "should delete a project issue" do
expect {
delete "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}" delete "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}"
}.to change { Issue.count }.by(-1) response.status.should == 405
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment