##// END OF EJS Templates
test: route: split wiki tests...
Toshi MARUYAMA -
r8325:d17b4c8e4f1f
parent child
Show More
@@ -18,7 +18,7
18 require File.expand_path('../../../test_helper', __FILE__)
18 require File.expand_path('../../../test_helper', __FILE__)
19
19
20 class RoutingWikiTest < ActionController::IntegrationTest
20 class RoutingWikiTest < ActionController::IntegrationTest
21 def test_wiki_singular_projects_pages
21 def test_wiki_matching
22 assert_routing(
22 assert_routing(
23 { :method => 'get', :path => "/projects/567/wiki" },
23 { :method => 'get', :path => "/projects/567/wiki" },
24 { :controller => 'wiki', :action => 'show', :project_id => '567' }
24 { :controller => 'wiki', :action => 'show', :project_id => '567' }
@@ -29,16 +29,6 class RoutingWikiTest < ActionController::IntegrationTest
29 :id => 'lalala' }
29 :id => 'lalala' }
30 )
30 )
31 assert_routing(
31 assert_routing(
32 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
33 { :controller => 'wiki', :action => 'edit', :project_id => '567',
34 :id => 'my_page' }
35 )
36 assert_routing(
37 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
38 { :controller => 'wiki', :action => 'history', :project_id => '1',
39 :id => 'CookBook_documentation' }
40 )
41 assert_routing(
42 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
32 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
43 { :controller => 'wiki', :action => 'diff', :project_id => '1',
33 { :controller => 'wiki', :action => 'diff', :project_id => '1',
44 :id => 'CookBook_documentation' }
34 :id => 'CookBook_documentation' }
@@ -58,22 +48,38 class RoutingWikiTest < ActionController::IntegrationTest
58 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
48 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
59 :id => 'CookBook_documentation', :version => '2' }
49 :id => 'CookBook_documentation', :version => '2' }
60 )
50 )
51 end
52
53 def test_wiki_misc
61 assert_routing(
54 assert_routing(
62 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
55 { :method => 'get', :path => "/projects/567/wiki/date_index" },
63 { :controller => 'wiki', :action => 'rename', :project_id => '22',
56 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
64 :id => 'ladida' }
57 )
58 assert_routing(
59 { :method => 'get', :path => "/projects/567/wiki/export" },
60 { :controller => 'wiki', :action => 'export', :project_id => '567' }
65 )
61 )
66 assert_routing(
62 assert_routing(
67 { :method => 'get', :path => "/projects/567/wiki/index" },
63 { :method => 'get', :path => "/projects/567/wiki/index" },
68 { :controller => 'wiki', :action => 'index', :project_id => '567' }
64 { :controller => 'wiki', :action => 'index', :project_id => '567' }
69 )
65 )
66 end
67
68 def test_wiki_resources
70 assert_routing(
69 assert_routing(
71 { :method => 'get', :path => "/projects/567/wiki/date_index" },
70 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
72 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
71 { :controller => 'wiki', :action => 'edit', :project_id => '567',
72 :id => 'my_page' }
73 )
73 )
74 assert_routing(
74 assert_routing(
75 { :method => 'get', :path => "/projects/567/wiki/export" },
75 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
76 { :controller => 'wiki', :action => 'export', :project_id => '567' }
76 { :controller => 'wiki', :action => 'history', :project_id => '1',
77 :id => 'CookBook_documentation' }
78 )
79 assert_routing(
80 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
81 { :controller => 'wiki', :action => 'rename', :project_id => '22',
82 :id => 'ladida' }
77 )
83 )
78 assert_routing(
84 assert_routing(
79 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
85 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
General Comments 0
You need to be logged in to leave comments. Login now