##// END OF EJS Templates
test: route: move comments tests in news test to new file...
Toshi MARUYAMA -
r8237:79c0b8bade76
parent child
Show More
@@ -0,0 +1,32
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 require File.expand_path('../../../test_helper', __FILE__)
19
20 class RoutingCommentsTest < ActionController::IntegrationTest
21 def test_comments
22 assert_routing(
23 { :method => 'post', :path => "/news/567/comments" },
24 { :controller => 'comments', :action => 'create', :id => '567' }
25 )
26 assert_routing(
27 { :method => 'delete', :path => "/news/567/comments/15" },
28 { :controller => 'comments', :action => 'destroy', :id => '567',
29 :comment_id => '15' }
30 )
31 end
32 end
@@ -1,319 +1,310
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class RoutingTest < ActionController::IntegrationTest
20 class RoutingTest < ActionController::IntegrationTest
21 def test_news
21 def test_news
22 assert_routing(
22 assert_routing(
23 { :method => 'get', :path => "/news" },
23 { :method => 'get', :path => "/news" },
24 { :controller => 'news', :action => 'index' }
24 { :controller => 'news', :action => 'index' }
25 )
25 )
26 assert_routing(
26 assert_routing(
27 { :method => 'get', :path => "/news.atom" },
27 { :method => 'get', :path => "/news.atom" },
28 { :controller => 'news', :action => 'index', :format => 'atom' }
28 { :controller => 'news', :action => 'index', :format => 'atom' }
29 )
29 )
30 assert_routing(
30 assert_routing(
31 { :method => 'get', :path => "/news.xml" },
31 { :method => 'get', :path => "/news.xml" },
32 { :controller => 'news', :action => 'index', :format => 'xml' }
32 { :controller => 'news', :action => 'index', :format => 'xml' }
33 )
33 )
34 assert_routing(
34 assert_routing(
35 { :method => 'get', :path => "/news.json" },
35 { :method => 'get', :path => "/news.json" },
36 { :controller => 'news', :action => 'index', :format => 'json' }
36 { :controller => 'news', :action => 'index', :format => 'json' }
37 )
37 )
38 assert_routing(
38 assert_routing(
39 { :method => 'get', :path => "/projects/567/news" },
39 { :method => 'get', :path => "/projects/567/news" },
40 { :controller => 'news', :action => 'index', :project_id => '567' }
40 { :controller => 'news', :action => 'index', :project_id => '567' }
41 )
41 )
42 assert_routing(
42 assert_routing(
43 { :method => 'get', :path => "/projects/567/news.atom" },
43 { :method => 'get', :path => "/projects/567/news.atom" },
44 { :controller => 'news', :action => 'index', :format => 'atom',
44 { :controller => 'news', :action => 'index', :format => 'atom',
45 :project_id => '567' }
45 :project_id => '567' }
46 )
46 )
47 assert_routing(
47 assert_routing(
48 { :method => 'get', :path => "/projects/567/news.xml" },
48 { :method => 'get', :path => "/projects/567/news.xml" },
49 { :controller => 'news', :action => 'index', :format => 'xml',
49 { :controller => 'news', :action => 'index', :format => 'xml',
50 :project_id => '567' }
50 :project_id => '567' }
51 )
51 )
52 assert_routing(
52 assert_routing(
53 { :method => 'get', :path => "/projects/567/news.json" },
53 { :method => 'get', :path => "/projects/567/news.json" },
54 { :controller => 'news', :action => 'index', :format => 'json',
54 { :controller => 'news', :action => 'index', :format => 'json',
55 :project_id => '567' }
55 :project_id => '567' }
56 )
56 )
57 assert_routing(
57 assert_routing(
58 { :method => 'get', :path => "/news/2" },
58 { :method => 'get', :path => "/news/2" },
59 { :controller => 'news', :action => 'show', :id => '2' }
59 { :controller => 'news', :action => 'show', :id => '2' }
60 )
60 )
61 assert_routing(
61 assert_routing(
62 { :method => 'get', :path => "/projects/567/news/new" },
62 { :method => 'get', :path => "/projects/567/news/new" },
63 { :controller => 'news', :action => 'new', :project_id => '567' }
63 { :controller => 'news', :action => 'new', :project_id => '567' }
64 )
64 )
65 assert_routing(
65 assert_routing(
66 { :method => 'get', :path => "/news/234" },
66 { :method => 'get', :path => "/news/234" },
67 { :controller => 'news', :action => 'show', :id => '234' }
67 { :controller => 'news', :action => 'show', :id => '234' }
68 )
68 )
69 assert_routing(
69 assert_routing(
70 { :method => 'get', :path => "/news/567/edit" },
70 { :method => 'get', :path => "/news/567/edit" },
71 { :controller => 'news', :action => 'edit', :id => '567' }
71 { :controller => 'news', :action => 'edit', :id => '567' }
72 )
72 )
73 assert_routing(
73 assert_routing(
74 { :method => 'post', :path => "/projects/567/news" },
74 { :method => 'post', :path => "/projects/567/news" },
75 { :controller => 'news', :action => 'create', :project_id => '567' }
75 { :controller => 'news', :action => 'create', :project_id => '567' }
76 )
76 )
77 assert_routing(
77 assert_routing(
78 { :method => 'post', :path => "/news/567/comments" },
79 { :controller => 'comments', :action => 'create', :id => '567' }
80 )
81 assert_routing(
82 { :method => 'put', :path => "/news/567" },
78 { :method => 'put', :path => "/news/567" },
83 { :controller => 'news', :action => 'update', :id => '567' }
79 { :controller => 'news', :action => 'update', :id => '567' }
84 )
80 )
85 assert_routing(
81 assert_routing(
86 { :method => 'delete', :path => "/news/567" },
82 { :method => 'delete', :path => "/news/567" },
87 { :controller => 'news', :action => 'destroy', :id => '567' }
83 { :controller => 'news', :action => 'destroy', :id => '567' }
88 )
84 )
89 assert_routing(
90 { :method => 'delete', :path => "/news/567/comments/15" },
91 { :controller => 'comments', :action => 'destroy', :id => '567',
92 :comment_id => '15' }
93 )
94 end
85 end
95
86
96 def test_projects
87 def test_projects
97 assert_routing(
88 assert_routing(
98 { :method => 'get', :path => "/projects" },
89 { :method => 'get', :path => "/projects" },
99 { :controller => 'projects', :action => 'index' }
90 { :controller => 'projects', :action => 'index' }
100 )
91 )
101 assert_routing(
92 assert_routing(
102 { :method => 'get', :path => "/projects.atom" },
93 { :method => 'get', :path => "/projects.atom" },
103 { :controller => 'projects', :action => 'index', :format => 'atom' }
94 { :controller => 'projects', :action => 'index', :format => 'atom' }
104 )
95 )
105 assert_routing(
96 assert_routing(
106 { :method => 'get', :path => "/projects.xml" },
97 { :method => 'get', :path => "/projects.xml" },
107 { :controller => 'projects', :action => 'index', :format => 'xml' }
98 { :controller => 'projects', :action => 'index', :format => 'xml' }
108 )
99 )
109 assert_routing(
100 assert_routing(
110 { :method => 'get', :path => "/projects/new" },
101 { :method => 'get', :path => "/projects/new" },
111 { :controller => 'projects', :action => 'new' }
102 { :controller => 'projects', :action => 'new' }
112 )
103 )
113 assert_routing(
104 assert_routing(
114 { :method => 'get', :path => "/projects/test" },
105 { :method => 'get', :path => "/projects/test" },
115 { :controller => 'projects', :action => 'show', :id => 'test' }
106 { :controller => 'projects', :action => 'show', :id => 'test' }
116 )
107 )
117 assert_routing(
108 assert_routing(
118 { :method => 'get', :path => "/projects/1.xml" },
109 { :method => 'get', :path => "/projects/1.xml" },
119 { :controller => 'projects', :action => 'show', :id => '1',
110 { :controller => 'projects', :action => 'show', :id => '1',
120 :format => 'xml' }
111 :format => 'xml' }
121 )
112 )
122 assert_routing(
113 assert_routing(
123 { :method => 'get', :path => "/projects/4223/settings" },
114 { :method => 'get', :path => "/projects/4223/settings" },
124 { :controller => 'projects', :action => 'settings', :id => '4223' }
115 { :controller => 'projects', :action => 'settings', :id => '4223' }
125 )
116 )
126 assert_routing(
117 assert_routing(
127 { :method => 'get', :path => "/projects/4223/settings/members" },
118 { :method => 'get', :path => "/projects/4223/settings/members" },
128 { :controller => 'projects', :action => 'settings', :id => '4223',
119 { :controller => 'projects', :action => 'settings', :id => '4223',
129 :tab => 'members' }
120 :tab => 'members' }
130 )
121 )
131 assert_routing(
122 assert_routing(
132 { :method => 'post', :path => "/projects" },
123 { :method => 'post', :path => "/projects" },
133 { :controller => 'projects', :action => 'create' }
124 { :controller => 'projects', :action => 'create' }
134 )
125 )
135 assert_routing(
126 assert_routing(
136 { :method => 'post', :path => "/projects.xml" },
127 { :method => 'post', :path => "/projects.xml" },
137 { :controller => 'projects', :action => 'create', :format => 'xml' }
128 { :controller => 'projects', :action => 'create', :format => 'xml' }
138 )
129 )
139 assert_routing(
130 assert_routing(
140 { :method => 'post', :path => "/projects/64/archive" },
131 { :method => 'post', :path => "/projects/64/archive" },
141 { :controller => 'projects', :action => 'archive', :id => '64' }
132 { :controller => 'projects', :action => 'archive', :id => '64' }
142 )
133 )
143 assert_routing(
134 assert_routing(
144 { :method => 'post', :path => "/projects/64/unarchive" },
135 { :method => 'post', :path => "/projects/64/unarchive" },
145 { :controller => 'projects', :action => 'unarchive', :id => '64' }
136 { :controller => 'projects', :action => 'unarchive', :id => '64' }
146 )
137 )
147 assert_routing(
138 assert_routing(
148 { :method => 'put', :path => "/projects/64/enumerations" },
139 { :method => 'put', :path => "/projects/64/enumerations" },
149 { :controller => 'project_enumerations', :action => 'update',
140 { :controller => 'project_enumerations', :action => 'update',
150 :project_id => '64' }
141 :project_id => '64' }
151 )
142 )
152 assert_routing(
143 assert_routing(
153 { :method => 'put', :path => "/projects/4223" },
144 { :method => 'put', :path => "/projects/4223" },
154 { :controller => 'projects', :action => 'update', :id => '4223' }
145 { :controller => 'projects', :action => 'update', :id => '4223' }
155 )
146 )
156 assert_routing(
147 assert_routing(
157 { :method => 'put', :path => "/projects/1.xml" },
148 { :method => 'put', :path => "/projects/1.xml" },
158 { :controller => 'projects', :action => 'update', :id => '1',
149 { :controller => 'projects', :action => 'update', :id => '1',
159 :format => 'xml' }
150 :format => 'xml' }
160 )
151 )
161 assert_routing(
152 assert_routing(
162 { :method => 'delete', :path => "/projects/64" },
153 { :method => 'delete', :path => "/projects/64" },
163 { :controller => 'projects', :action => 'destroy', :id => '64' }
154 { :controller => 'projects', :action => 'destroy', :id => '64' }
164 )
155 )
165 assert_routing(
156 assert_routing(
166 { :method => 'delete', :path => "/projects/1.xml" },
157 { :method => 'delete', :path => "/projects/1.xml" },
167 { :controller => 'projects', :action => 'destroy', :id => '1',
158 { :controller => 'projects', :action => 'destroy', :id => '1',
168 :format => 'xml' }
159 :format => 'xml' }
169 )
160 )
170 assert_routing(
161 assert_routing(
171 { :method => 'delete', :path => "/projects/64/enumerations" },
162 { :method => 'delete', :path => "/projects/64/enumerations" },
172 { :controller => 'project_enumerations', :action => 'destroy',
163 { :controller => 'project_enumerations', :action => 'destroy',
173 :project_id => '64' }
164 :project_id => '64' }
174 )
165 )
175 end
166 end
176
167
177 def test_queries
168 def test_queries
178 assert_routing(
169 assert_routing(
179 { :method => 'get', :path => "/queries.xml" },
170 { :method => 'get', :path => "/queries.xml" },
180 { :controller => 'queries', :action => 'index', :format => 'xml' }
171 { :controller => 'queries', :action => 'index', :format => 'xml' }
181 )
172 )
182 assert_routing(
173 assert_routing(
183 { :method => 'get', :path => "/queries.json" },
174 { :method => 'get', :path => "/queries.json" },
184 { :controller => 'queries', :action => 'index', :format => 'json' }
175 { :controller => 'queries', :action => 'index', :format => 'json' }
185 )
176 )
186 assert_routing(
177 assert_routing(
187 { :method => 'get', :path => "/queries/new" },
178 { :method => 'get', :path => "/queries/new" },
188 { :controller => 'queries', :action => 'new' }
179 { :controller => 'queries', :action => 'new' }
189 )
180 )
190 assert_routing(
181 assert_routing(
191 { :method => 'get', :path => "/projects/redmine/queries/new" },
182 { :method => 'get', :path => "/projects/redmine/queries/new" },
192 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
183 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
193 )
184 )
194 assert_routing(
185 assert_routing(
195 { :method => 'post', :path => "/queries" },
186 { :method => 'post', :path => "/queries" },
196 { :controller => 'queries', :action => 'create' }
187 { :controller => 'queries', :action => 'create' }
197 )
188 )
198 assert_routing(
189 assert_routing(
199 { :method => 'post', :path => "/projects/redmine/queries" },
190 { :method => 'post', :path => "/projects/redmine/queries" },
200 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
191 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
201 )
192 )
202 assert_routing(
193 assert_routing(
203 { :method => 'get', :path => "/queries/1/edit" },
194 { :method => 'get', :path => "/queries/1/edit" },
204 { :controller => 'queries', :action => 'edit', :id => '1' }
195 { :controller => 'queries', :action => 'edit', :id => '1' }
205 )
196 )
206 assert_routing(
197 assert_routing(
207 { :method => 'put', :path => "/queries/1" },
198 { :method => 'put', :path => "/queries/1" },
208 { :controller => 'queries', :action => 'update', :id => '1' }
199 { :controller => 'queries', :action => 'update', :id => '1' }
209 )
200 )
210 assert_routing(
201 assert_routing(
211 { :method => 'delete', :path => "/queries/1" },
202 { :method => 'delete', :path => "/queries/1" },
212 { :controller => 'queries', :action => 'destroy', :id => '1' }
203 { :controller => 'queries', :action => 'destroy', :id => '1' }
213 )
204 )
214 end
205 end
215
206
216 def test_wiki_singular_projects_pages
207 def test_wiki_singular_projects_pages
217 assert_routing(
208 assert_routing(
218 { :method => 'get', :path => "/projects/567/wiki" },
209 { :method => 'get', :path => "/projects/567/wiki" },
219 { :controller => 'wiki', :action => 'show', :project_id => '567' }
210 { :controller => 'wiki', :action => 'show', :project_id => '567' }
220 )
211 )
221 assert_routing(
212 assert_routing(
222 { :method => 'get', :path => "/projects/567/wiki/lalala" },
213 { :method => 'get', :path => "/projects/567/wiki/lalala" },
223 { :controller => 'wiki', :action => 'show', :project_id => '567',
214 { :controller => 'wiki', :action => 'show', :project_id => '567',
224 :id => 'lalala' }
215 :id => 'lalala' }
225 )
216 )
226 assert_routing(
217 assert_routing(
227 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
218 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
228 { :controller => 'wiki', :action => 'edit', :project_id => '567',
219 { :controller => 'wiki', :action => 'edit', :project_id => '567',
229 :id => 'my_page' }
220 :id => 'my_page' }
230 )
221 )
231 assert_routing(
222 assert_routing(
232 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
223 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
233 { :controller => 'wiki', :action => 'history', :project_id => '1',
224 { :controller => 'wiki', :action => 'history', :project_id => '1',
234 :id => 'CookBook_documentation' }
225 :id => 'CookBook_documentation' }
235 )
226 )
236 assert_routing(
227 assert_routing(
237 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
228 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
238 { :controller => 'wiki', :action => 'diff', :project_id => '1',
229 { :controller => 'wiki', :action => 'diff', :project_id => '1',
239 :id => 'CookBook_documentation' }
230 :id => 'CookBook_documentation' }
240 )
231 )
241 assert_routing(
232 assert_routing(
242 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
233 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
243 { :controller => 'wiki', :action => 'diff', :project_id => '1',
234 { :controller => 'wiki', :action => 'diff', :project_id => '1',
244 :id => 'CookBook_documentation', :version => '2' }
235 :id => 'CookBook_documentation', :version => '2' }
245 )
236 )
246 assert_routing(
237 assert_routing(
247 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
238 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
248 { :controller => 'wiki', :action => 'diff', :project_id => '1',
239 { :controller => 'wiki', :action => 'diff', :project_id => '1',
249 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
240 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
250 )
241 )
251 assert_routing(
242 assert_routing(
252 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
243 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
253 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
244 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
254 :id => 'CookBook_documentation', :version => '2' }
245 :id => 'CookBook_documentation', :version => '2' }
255 )
246 )
256 assert_routing(
247 assert_routing(
257 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
248 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
258 { :controller => 'wiki', :action => 'rename', :project_id => '22',
249 { :controller => 'wiki', :action => 'rename', :project_id => '22',
259 :id => 'ladida' }
250 :id => 'ladida' }
260 )
251 )
261 assert_routing(
252 assert_routing(
262 { :method => 'get', :path => "/projects/567/wiki/index" },
253 { :method => 'get', :path => "/projects/567/wiki/index" },
263 { :controller => 'wiki', :action => 'index', :project_id => '567' }
254 { :controller => 'wiki', :action => 'index', :project_id => '567' }
264 )
255 )
265 assert_routing(
256 assert_routing(
266 { :method => 'get', :path => "/projects/567/wiki/date_index" },
257 { :method => 'get', :path => "/projects/567/wiki/date_index" },
267 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
258 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
268 )
259 )
269 assert_routing(
260 assert_routing(
270 { :method => 'get', :path => "/projects/567/wiki/export" },
261 { :method => 'get', :path => "/projects/567/wiki/export" },
271 { :controller => 'wiki', :action => 'export', :project_id => '567' }
262 { :controller => 'wiki', :action => 'export', :project_id => '567' }
272 )
263 )
273 assert_routing(
264 assert_routing(
274 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
265 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
275 { :controller => 'wiki', :action => 'preview', :project_id => '567',
266 { :controller => 'wiki', :action => 'preview', :project_id => '567',
276 :id => 'CookBook_documentation' }
267 :id => 'CookBook_documentation' }
277 )
268 )
278 assert_routing(
269 assert_routing(
279 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
270 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
280 { :controller => 'wiki', :action => 'rename', :project_id => '22',
271 { :controller => 'wiki', :action => 'rename', :project_id => '22',
281 :id => 'ladida' }
272 :id => 'ladida' }
282 )
273 )
283 assert_routing(
274 assert_routing(
284 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
275 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
285 { :controller => 'wiki', :action => 'protect', :project_id => '22',
276 { :controller => 'wiki', :action => 'protect', :project_id => '22',
286 :id => 'ladida' }
277 :id => 'ladida' }
287 )
278 )
288 assert_routing(
279 assert_routing(
289 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
280 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
290 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
281 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
291 :id => 'ladida' }
282 :id => 'ladida' }
292 )
283 )
293 assert_routing(
284 assert_routing(
294 { :method => 'put', :path => "/projects/567/wiki/my_page" },
285 { :method => 'put', :path => "/projects/567/wiki/my_page" },
295 { :controller => 'wiki', :action => 'update', :project_id => '567',
286 { :controller => 'wiki', :action => 'update', :project_id => '567',
296 :id => 'my_page' }
287 :id => 'my_page' }
297 )
288 )
298 assert_routing(
289 assert_routing(
299 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
290 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
300 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
291 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
301 :id => 'ladida' }
292 :id => 'ladida' }
302 )
293 )
303 end
294 end
304
295
305 def test_wikis_plural_admin_setup
296 def test_wikis_plural_admin_setup
306 assert_routing(
297 assert_routing(
307 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
298 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
308 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
299 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
309 )
300 )
310 assert_routing(
301 assert_routing(
311 { :method => 'post', :path => "/projects/ladida/wiki" },
302 { :method => 'post', :path => "/projects/ladida/wiki" },
312 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
303 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
313 )
304 )
314 assert_routing(
305 assert_routing(
315 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
306 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
316 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
307 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
317 )
308 )
318 end
309 end
319 end
310 end
General Comments 0
You need to be logged in to leave comments. Login now