From b838440f15fbc56d0504162fcff376cacf9c8186 Mon Sep 17 00:00:00 2001
From: Robert Speicher <rspeicher@gmail.com>
Date: Wed, 22 Aug 2012 13:26:09 -0400
Subject: [PATCH] Deprecate the DELETE method for Issues API

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

Closes #1245
Closes #1264
---
 lib/api/issues.rb       | 5 ++---
 spec/api/issues_spec.rb | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 2abc20ad34e..836c2818544 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -95,7 +95,7 @@ module Gitlab
         end
       end
 
-      # Delete a project issue
+      # Delete a project issue (deprecated)
       #
       # Parameters:
       #   id (required) - The ID or code name of a project
@@ -103,8 +103,7 @@ module Gitlab
       # Example Request:
       #   DELETE /projects/:id/issues/:issue_id
       delete ":id/issues/:issue_id" do
-        @issue = user_project.issues.find(params[:issue_id])
-        @issue.destroy
+        error!({'message' => 'method not allowed'}, 405)
       end
     end
   end
diff --git a/spec/api/issues_spec.rb b/spec/api/issues_spec.rb
index f6d8e3792c2..62814307bf6 100644
--- a/spec/api/issues_spec.rb
+++ b/spec/api/issues_spec.rb
@@ -63,9 +63,8 @@ describe Gitlab::API do
 
   describe "DELETE /projects/:id/issues/:issue_id" do
     it "should delete a project issue" do
-      expect {
-        delete "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}"
-      }.to change { Issue.count }.by(-1)
+      delete "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}"
+      response.status.should == 405
     end
   end
 end
-- 
GitLab