summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-27 16:37:15 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-27 16:37:15 +0000
commit3d6cb1435cdf0fa0049c52f7701014bdcde67125 (patch)
tree228fb69866ea07346d8b609e9e5315da98218719 /test/integration
parent054b7d28f1994a61c04d837a066fa0164d439858 (diff)
downloadredmine-3d6cb1435cdf0fa0049c52f7701014bdcde67125.tar.gz
redmine-3d6cb1435cdf0fa0049c52f7701014bdcde67125.zip
Accept key auth for ProjectsController#destroy (#6841).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4443 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/projects_test.rb22
1 files changed, 14 insertions, 8 deletions
diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb
index c2ffa6920..cdac77ef9 100644
--- a/test/integration/api_test/projects_test.rb
+++ b/test/integration/api_test/projects_test.rb
@@ -31,7 +31,7 @@ class ApiTest::ProjectsTest < ActionController::IntegrationTest
assert_response :success
assert_equal 'application/xml', @response.content_type
end
-
+
def test_show
get '/projects/1.xml'
assert_response :success
@@ -104,14 +104,20 @@ class ApiTest::ProjectsTest < ActionController::IntegrationTest
assert_equal 'application/xml', @response.content_type
assert_tag :errors, :child => {:tag => 'error', :content => "Name can't be blank"}
end
-
- def test_destroy
- assert_difference 'Project.count', -1 do
- delete '/projects/2.xml', {}, :authorization => credentials('admin')
+
+ context "DELETE /projects/2.xml" do
+ should_allow_api_authentication(:delete,
+ '/projects/2.xml',
+ {},
+ {:success_code => :ok})
+
+ should "delete the project" do
+ assert_difference('Project.count',-1) do
+ delete '/projects/2.xml', {}, :authorization => credentials('admin')
+ end
+ assert_response :ok
+ assert_nil Project.find_by_id(2)
end
- assert_response :ok
- assert_equal 'application/xml', @response.content_type
- assert_nil Project.find_by_id(2)
end
def credentials(user, password=nil)