diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-31 05:08:54 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-31 05:08:54 +0000 |
commit | d17b4c8e4f1f6d382486038d09a65b9f5f17ce3c (patch) | |
tree | 9b25be0275f7f519a8a7ebf937bfb17c393cd9d7 /test/integration/routing/wiki_test.rb | |
parent | ab60ce54f507b1e2d670508e1884dea066f8e0ce (diff) | |
download | redmine-d17b4c8e4f1f6d382486038d09a65b9f5f17ce3c.tar.gz redmine-d17b4c8e4f1f6d382486038d09a65b9f5f17ce3c.zip |
test: route: split wiki tests
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8445 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/routing/wiki_test.rb')
-rw-r--r-- | test/integration/routing/wiki_test.rb | 72 |
1 files changed, 39 insertions, 33 deletions
diff --git a/test/integration/routing/wiki_test.rb b/test/integration/routing/wiki_test.rb index 30835151e..1445442b5 100644 --- a/test/integration/routing/wiki_test.rb +++ b/test/integration/routing/wiki_test.rb @@ -18,7 +18,7 @@ require File.expand_path('../../../test_helper', __FILE__) class RoutingWikiTest < ActionController::IntegrationTest - def test_wiki_singular_projects_pages + def test_wiki_matching assert_routing( { :method => 'get', :path => "/projects/567/wiki" }, { :controller => 'wiki', :action => 'show', :project_id => '567' } @@ -27,8 +27,46 @@ class RoutingWikiTest < ActionController::IntegrationTest { :method => 'get', :path => "/projects/567/wiki/lalala" }, { :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala' } + ) + assert_routing( + { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" }, + { :controller => 'wiki', :action => 'diff', :project_id => '1', + :id => 'CookBook_documentation' } + ) + assert_routing( + { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" }, + { :controller => 'wiki', :action => 'diff', :project_id => '1', + :id => 'CookBook_documentation', :version => '2' } + ) + assert_routing( + { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" }, + { :controller => 'wiki', :action => 'diff', :project_id => '1', + :id => 'CookBook_documentation', :version => '2', :version_from => '1' } + ) + assert_routing( + { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" }, + { :controller => 'wiki', :action => 'annotate', :project_id => '1', + :id => 'CookBook_documentation', :version => '2' } + ) + end + + def test_wiki_misc + assert_routing( + { :method => 'get', :path => "/projects/567/wiki/date_index" }, + { :controller => 'wiki', :action => 'date_index', :project_id => '567' } + ) + assert_routing( + { :method => 'get', :path => "/projects/567/wiki/export" }, + { :controller => 'wiki', :action => 'export', :project_id => '567' } ) assert_routing( + { :method => 'get', :path => "/projects/567/wiki/index" }, + { :controller => 'wiki', :action => 'index', :project_id => '567' } + ) + end + + def test_wiki_resources + assert_routing( { :method => 'get', :path => "/projects/567/wiki/my_page/edit" }, { :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page' } @@ -39,43 +77,11 @@ class RoutingWikiTest < ActionController::IntegrationTest :id => 'CookBook_documentation' } ) assert_routing( - { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" }, - { :controller => 'wiki', :action => 'diff', :project_id => '1', - :id => 'CookBook_documentation' } - ) - assert_routing( - { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" }, - { :controller => 'wiki', :action => 'diff', :project_id => '1', - :id => 'CookBook_documentation', :version => '2' } - ) - assert_routing( - { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" }, - { :controller => 'wiki', :action => 'diff', :project_id => '1', - :id => 'CookBook_documentation', :version => '2', :version_from => '1' } - ) - assert_routing( - { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" }, - { :controller => 'wiki', :action => 'annotate', :project_id => '1', - :id => 'CookBook_documentation', :version => '2' } - ) - assert_routing( { :method => 'get', :path => "/projects/22/wiki/ladida/rename" }, { :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' } ) assert_routing( - { :method => 'get', :path => "/projects/567/wiki/index" }, - { :controller => 'wiki', :action => 'index', :project_id => '567' } - ) - assert_routing( - { :method => 'get', :path => "/projects/567/wiki/date_index" }, - { :controller => 'wiki', :action => 'date_index', :project_id => '567' } - ) - assert_routing( - { :method => 'get', :path => "/projects/567/wiki/export" }, - { :controller => 'wiki', :action => 'export', :project_id => '567' } - ) - assert_routing( { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" }, { :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation' } |