REST API for deleting wiki pages (#7082).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10743 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-10-28 20:17:38 +00:00
parent 625eebb720
commit beb2610650
3 changed files with 26 additions and 3 deletions
@@ -181,4 +181,13 @@ class ApiTest::WikiPagesTest < ActionController::IntegrationTest
assert_equal 'New_subpage_from_API', page.title
assert_equal WikiPage.find(1), page.parent
end
test "DELETE /projects/:project_id/wiki/:title.xml should destroy the page" do
assert_difference 'WikiPage.count', -1 do
delete '/projects/ecookbook/wiki/CookBook_documentation.xml', {}, credentials('jsmith')
assert_response 200
end
assert_nil WikiPage.find_by_id(1)
end
end
+10
View File
@@ -168,5 +168,15 @@ class RoutingWikiTest < ActionController::IntegrationTest
{ :controller => 'wiki', :action => 'update', :project_id => '567',
:id => 'my_page', :format => 'json' }
)
assert_routing(
{ :method => 'delete', :path => "/projects/567/wiki/my_page.xml" },
{ :controller => 'wiki', :action => 'destroy', :project_id => '567',
:id => 'my_page', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/projects/567/wiki/my_page.json" },
{ :controller => 'wiki', :action => 'destroy', :project_id => '567',
:id => 'my_page', :format => 'json' }
)
end
end