@@ -27,7 +27,7 class IssuesController < ApplicationController | |||
|
27 | 27 | before_filter :find_optional_project, :only => [:index] |
|
28 | 28 | before_filter :check_for_default_issue_status, :only => [:new, :create] |
|
29 | 29 | before_filter :build_new_issue_from_params, :only => [:new, :create] |
|
30 | accept_key_auth :index, :show, :create, :update | |
|
30 | accept_key_auth :index, :show, :create, :update, :destroy | |
|
31 | 31 | |
|
32 | 32 | rescue_from Query::StatementInvalid, :with => :query_statement_invalid |
|
33 | 33 |
@@ -301,32 +301,32 class ApiTest::IssuesTest < ActionController::IntegrationTest | |||
|
301 | 301 | end |
|
302 | 302 | |
|
303 | 303 | context "DELETE /issues/1.xml" do |
|
304 | setup do | |
|
305 | @issue_count = Issue.count | |
|
306 | delete '/issues/1.xml', {}, :authorization => credentials('jsmith') | |
|
307 | end | |
|
308 | ||
|
309 | should_respond_with :ok | |
|
310 | should_respond_with_content_type 'application/xml' | |
|
304 | should_allow_api_authentication(:delete, | |
|
305 | '/issues/6.xml', | |
|
306 | {}, | |
|
307 | {:success_code => :ok}) | |
|
311 | 308 | |
|
312 | 309 | should "delete the issue" do |
|
313 |
assert_ |
|
|
314 | assert_nil Issue.find_by_id(1) | |
|
315 | end | |
|
310 | assert_difference('Issue.count',-1) do | |
|
311 | delete '/issues/6.xml', {}, :authorization => credentials('jsmith') | |
|
316 | 312 | end |
|
317 | 313 | |
|
318 | context "DELETE /issues/1.json" do | |
|
319 |
|
|
|
320 | @issue_count = Issue.count | |
|
321 | delete '/issues/1.json', {}, :authorization => credentials('jsmith') | |
|
314 | assert_nil Issue.find_by_id(6) | |
|
315 | end | |
|
322 | 316 |
|
|
323 | 317 | |
|
324 | should_respond_with :ok | |
|
325 | should_respond_with_content_type 'application/json' | |
|
318 | context "DELETE /issues/1.json" do | |
|
319 | should_allow_api_authentication(:delete, | |
|
320 | '/issues/6.json', | |
|
321 | {}, | |
|
322 | {:success_code => :ok}) | |
|
326 | 323 | |
|
327 | 324 | should "delete the issue" do |
|
328 |
assert_ |
|
|
329 | assert_nil Issue.find_by_id(1) | |
|
325 | assert_difference('Issue.count',-1) do | |
|
326 | delete '/issues/6.json', {}, :authorization => credentials('jsmith') | |
|
327 | end | |
|
328 | ||
|
329 | assert_nil Issue.find_by_id(6) | |
|
330 | 330 | end |
|
331 | 331 | end |
|
332 | 332 |
General Comments 0
You need to be logged in to leave comments.
Login now