From beb2610650595d4333fa88eb648146a6a26ad761 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 28 Oct 2012 20:17:38 +0000 Subject: REST API for deleting wiki pages (#7082). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10743 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/api_test/wiki_pages_test.rb | 9 +++++++++ test/integration/routing/wiki_test.rb | 10 ++++++++++ 2 files changed, 19 insertions(+) (limited to 'test') diff --git a/test/integration/api_test/wiki_pages_test.rb b/test/integration/api_test/wiki_pages_test.rb index f9ec2bfe7..93db5aa51 100644 --- a/test/integration/api_test/wiki_pages_test.rb +++ b/test/integration/api_test/wiki_pages_test.rb @@ -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 diff --git a/test/integration/routing/wiki_test.rb b/test/integration/routing/wiki_test.rb index 2c85a62ee..5deeb7ee1 100644 --- a/test/integration/routing/wiki_test.rb +++ b/test/integration/routing/wiki_test.rb @@ -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 -- cgit v1.2.3