diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-28 20:17:38 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-28 20:17:38 +0000 |
commit | beb2610650595d4333fa88eb648146a6a26ad761 (patch) | |
tree | d66e443f66a843a342d04f956b1ad4fb8fb6c682 /test | |
parent | 625eebb720606efbd7e7094a34b8a9ba24ba6954 (diff) | |
download | redmine-beb2610650595d4333fa88eb648146a6a26ad761.tar.gz redmine-beb2610650595d4333fa88eb648146a6a26ad761.zip |
REST API for deleting wiki pages (#7082).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10743 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/api_test/wiki_pages_test.rb | 9 | ||||
-rw-r--r-- | test/integration/routing/wiki_test.rb | 10 |
2 files changed, 19 insertions, 0 deletions
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 |