diff options
Diffstat (limited to 'test/integration/routing/wiki_test.rb')
-rw-r--r-- | test/integration/routing/wiki_test.rb | 69 |
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 |