summaryrefslogtreecommitdiffstats
path: root/test/integration/routing/wiki_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-25 20:38:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-25 20:38:29 +0000
commiteff874b29a908e85e80d8bcd6a20fd85165e59cd (patch)
tree914366bfb252d98ef35bde6e738e880e98e9483d /test/integration/routing/wiki_test.rb
parent9e313087205721ed3c6239be7cde55598d29f9e6 (diff)
downloadredmine-eff874b29a908e85e80d8bcd6a20fd85165e59cd.tar.gz
redmine-eff874b29a908e85e80d8bcd6a20fd85165e59cd.zip
REST API for creating/updating wiki pages (#7082).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10717 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/routing/wiki_test.rb')
-rw-r--r--test/integration/routing/wiki_test.rb69
1 files changed, 41 insertions, 28 deletions
diff --git a/test/integration/routing/wiki_test.rb b/test/integration/routing/wiki_test.rb
index 29b305cd6..2c85a62ee 100644
--- a/test/integration/routing/wiki_test.rb
+++ b/test/integration/routing/wiki_test.rb
@@ -34,16 +34,6 @@ class RoutingWikiTest < ActionController::IntegrationTest
:id => 'lalala', :format => 'pdf' }
)
assert_routing(
- { :method => 'get', :path => "/projects/567/wiki/lalala.xml" },
- { :controller => 'wiki', :action => 'show', :project_id => '567',
- :id => 'lalala', :format => 'xml' }
- )
- assert_routing(
- { :method => 'get', :path => "/projects/567/wiki/lalala.json" },
- { :controller => 'wiki', :action => 'show', :project_id => '567',
- :id => 'lalala', :format => 'json' }
- )
- assert_routing(
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
{ :controller => 'wiki', :action => 'diff', :project_id => '1',
:id => 'CookBook_documentation' }
@@ -54,16 +44,6 @@ class RoutingWikiTest < ActionController::IntegrationTest
:id => 'CookBook_documentation', :version => '2' }
)
assert_routing(
- { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2.xml" },
- { :controller => 'wiki', :action => 'show', :project_id => '1',
- :id => 'CookBook_documentation', :version => '2', :format => 'xml' }
- )
- assert_routing(
- { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2.json" },
- { :controller => 'wiki', :action => 'show', :project_id => '1',
- :id => 'CookBook_documentation', :version => '2', :format => 'json' }
- )
- assert_routing(
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2/diff" },
{ :controller => 'wiki', :action => 'diff', :project_id => '1',
:id => 'CookBook_documentation', :version => '2' }
@@ -92,14 +72,6 @@ class RoutingWikiTest < ActionController::IntegrationTest
{ :method => 'get', :path => "/projects/567/wiki/index" },
{ :controller => 'wiki', :action => 'index', :project_id => '567' }
)
- assert_routing(
- { :method => 'get', :path => "/projects/567/wiki/index.xml" },
- { :controller => 'wiki', :action => 'index', :project_id => '567', :format => 'xml' }
- )
- assert_routing(
- { :method => 'get', :path => "/projects/567/wiki/index.json" },
- { :controller => 'wiki', :action => 'index', :project_id => '567', :format => 'json' }
- )
end
def test_wiki_resources
@@ -156,4 +128,45 @@ class RoutingWikiTest < ActionController::IntegrationTest
:id => 'ladida', :version => '3' }
)
end
+
+ def test_api
+ assert_routing(
+ { :method => 'get', :path => "/projects/567/wiki/my_page.xml" },
+ { :controller => 'wiki', :action => 'show', :project_id => '567',
+ :id => 'my_page', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/projects/567/wiki/my_page.json" },
+ { :controller => 'wiki', :action => 'show', :project_id => '567',
+ :id => 'my_page', :format => 'json' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2.xml" },
+ { :controller => 'wiki', :action => 'show', :project_id => '1',
+ :id => 'CookBook_documentation', :version => '2', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2.json" },
+ { :controller => 'wiki', :action => 'show', :project_id => '1',
+ :id => 'CookBook_documentation', :version => '2', :format => 'json' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/projects/567/wiki/index.xml" },
+ { :controller => 'wiki', :action => 'index', :project_id => '567', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/projects/567/wiki/index.json" },
+ { :controller => 'wiki', :action => 'index', :project_id => '567', :format => 'json' }
+ )
+ assert_routing(
+ { :method => 'put', :path => "/projects/567/wiki/my_page.xml" },
+ { :controller => 'wiki', :action => 'update', :project_id => '567',
+ :id => 'my_page', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'put', :path => "/projects/567/wiki/my_page.json" },
+ { :controller => 'wiki', :action => 'update', :project_id => '567',
+ :id => 'my_page', :format => 'json' }
+ )
+ end
end