mirror of
https://github.com/redmine/redmine.git
synced 2025-11-05 04:45:57 +01:00
Accept key auth for ProjectsController#destroy (#6841).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4443 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user