summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-11-05 17:49:25 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-11-05 17:49:25 +0000
commitc55e060bab6236b37de96267476fd6c09d8be30e (patch)
treee517783bdac46bd3b8922dd1c860a9993fc6c295 /test/integration
parent7d934c984ae85b50e53a6444cd8916d560e2a528 (diff)
downloadredmine-c55e060bab6236b37de96267476fd6c09d8be30e.tar.gz
redmine-c55e060bab6236b37de96267476fd6c09d8be30e.zip
Allow key authentication when deleting issues (with tests) #6447
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4367 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/issues_test.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb
index 55f78e86b..60ee66bb9 100644
--- a/test/integration/api_test/issues_test.rb
+++ b/test/integration/api_test/issues_test.rb
@@ -301,32 +301,32 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest
end
context "DELETE /issues/1.xml" do
- setup do
- @issue_count = Issue.count
- delete '/issues/1.xml', {}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/xml'
+ should_allow_api_authentication(:delete,
+ '/issues/6.xml',
+ {},
+ {:success_code => :ok})
should "delete the issue" do
- assert_equal Issue.count, @issue_count -1
- assert_nil Issue.find_by_id(1)
+ assert_difference('Issue.count',-1) do
+ delete '/issues/6.xml', {}, :authorization => credentials('jsmith')
+ end
+
+ assert_nil Issue.find_by_id(6)
end
end
context "DELETE /issues/1.json" do
- setup do
- @issue_count = Issue.count
- delete '/issues/1.json', {}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/json'
+ should_allow_api_authentication(:delete,
+ '/issues/6.json',
+ {},
+ {:success_code => :ok})
should "delete the issue" do
- assert_equal Issue.count, @issue_count -1
- assert_nil Issue.find_by_id(1)
+ assert_difference('Issue.count',-1) do
+ delete '/issues/6.json', {}, :authorization => credentials('jsmith')
+ end
+
+ assert_nil Issue.find_by_id(6)
end
end