From d17b4c8e4f1f6d382486038d09a65b9f5f17ce3c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 31 Dec 2011 05:08:54 +0000 Subject: [PATCH] test: route: split wiki tests git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8445 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/routing/wiki_test.rb | 72 +++++++++++++++------------ 1 file 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,7 +27,45 @@ 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', @@ -38,43 +76,11 @@ class RoutingWikiTest < ActionController::IntegrationTest { :controller => 'wiki', :action => 'history', :project_id => '1', :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',