]> source.dussan.org Git - redmine.git/commitdiff
test: route: split wiki tests
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 31 Dec 2011 05:08:54 +0000 (05:08 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 31 Dec 2011 05:08:54 +0000 (05:08 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8445 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing/wiki_test.rb

index 30835151e3b5af4ee09ff99d3ff683abc1d17d19..1445442b5e7630048e24f74988034bc256797399 100644 (file)
@@ -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',