##// END OF EJS Templates
test: route: move auto_completes tests in test_issues_extra_actions to new file...
Toshi MARUYAMA -
r8227:b19ea60b970e
parent child
Show More
@@ -0,0 +1,27
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 RoutingAutoCompletesTest < ActionController::IntegrationTest
21 def test_auto_completes
22 assert_routing(
23 { :method => 'get', :path => "/issues/auto_complete" },
24 { :controller => 'auto_completes', :action => 'issues' }
25 )
26 end
27 end
@@ -1,657 +1,653
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_issues_rest_actions
21 def test_issues_rest_actions
22 assert_routing(
22 assert_routing(
23 { :method => 'get', :path => "/issues" },
23 { :method => 'get', :path => "/issues" },
24 { :controller => 'issues', :action => 'index' }
24 { :controller => 'issues', :action => 'index' }
25 )
25 )
26 assert_routing(
26 assert_routing(
27 { :method => 'get', :path => "/issues.pdf" },
27 { :method => 'get', :path => "/issues.pdf" },
28 { :controller => 'issues', :action => 'index', :format => 'pdf' }
28 { :controller => 'issues', :action => 'index', :format => 'pdf' }
29 )
29 )
30 assert_routing(
30 assert_routing(
31 { :method => 'get', :path => "/issues.atom" },
31 { :method => 'get', :path => "/issues.atom" },
32 { :controller => 'issues', :action => 'index', :format => 'atom' }
32 { :controller => 'issues', :action => 'index', :format => 'atom' }
33 )
33 )
34 assert_routing(
34 assert_routing(
35 { :method => 'get', :path => "/issues.xml" },
35 { :method => 'get', :path => "/issues.xml" },
36 { :controller => 'issues', :action => 'index', :format => 'xml' }
36 { :controller => 'issues', :action => 'index', :format => 'xml' }
37 )
37 )
38 assert_routing(
38 assert_routing(
39 { :method => 'get', :path => "/projects/23/issues" },
39 { :method => 'get', :path => "/projects/23/issues" },
40 { :controller => 'issues', :action => 'index', :project_id => '23' }
40 { :controller => 'issues', :action => 'index', :project_id => '23' }
41 )
41 )
42 assert_routing(
42 assert_routing(
43 { :method => 'get', :path => "/projects/23/issues.pdf" },
43 { :method => 'get', :path => "/projects/23/issues.pdf" },
44 { :controller => 'issues', :action => 'index', :project_id => '23',
44 { :controller => 'issues', :action => 'index', :project_id => '23',
45 :format => 'pdf' }
45 :format => 'pdf' }
46 )
46 )
47 assert_routing(
47 assert_routing(
48 { :method => 'get', :path => "/projects/23/issues.atom" },
48 { :method => 'get', :path => "/projects/23/issues.atom" },
49 { :controller => 'issues', :action => 'index', :project_id => '23',
49 { :controller => 'issues', :action => 'index', :project_id => '23',
50 :format => 'atom' }
50 :format => 'atom' }
51 )
51 )
52 assert_routing(
52 assert_routing(
53 { :method => 'get', :path => "/projects/23/issues.xml" },
53 { :method => 'get', :path => "/projects/23/issues.xml" },
54 { :controller => 'issues', :action => 'index', :project_id => '23',
54 { :controller => 'issues', :action => 'index', :project_id => '23',
55 :format => 'xml' }
55 :format => 'xml' }
56 )
56 )
57 assert_routing(
57 assert_routing(
58 { :method => 'get', :path => "/issues/64" },
58 { :method => 'get', :path => "/issues/64" },
59 { :controller => 'issues', :action => 'show', :id => '64' }
59 { :controller => 'issues', :action => 'show', :id => '64' }
60 )
60 )
61 assert_routing(
61 assert_routing(
62 { :method => 'get', :path => "/issues/64.pdf" },
62 { :method => 'get', :path => "/issues/64.pdf" },
63 { :controller => 'issues', :action => 'show', :id => '64',
63 { :controller => 'issues', :action => 'show', :id => '64',
64 :format => 'pdf' }
64 :format => 'pdf' }
65 )
65 )
66 assert_routing(
66 assert_routing(
67 { :method => 'get', :path => "/issues/64.atom" },
67 { :method => 'get', :path => "/issues/64.atom" },
68 { :controller => 'issues', :action => 'show', :id => '64',
68 { :controller => 'issues', :action => 'show', :id => '64',
69 :format => 'atom' }
69 :format => 'atom' }
70 )
70 )
71 assert_routing(
71 assert_routing(
72 { :method => 'get', :path => "/issues/64.xml" },
72 { :method => 'get', :path => "/issues/64.xml" },
73 { :controller => 'issues', :action => 'show', :id => '64',
73 { :controller => 'issues', :action => 'show', :id => '64',
74 :format => 'xml' }
74 :format => 'xml' }
75 )
75 )
76 assert_routing(
76 assert_routing(
77 { :method => 'get', :path => "/projects/23/issues/new" },
77 { :method => 'get', :path => "/projects/23/issues/new" },
78 { :controller => 'issues', :action => 'new', :project_id => '23' }
78 { :controller => 'issues', :action => 'new', :project_id => '23' }
79 )
79 )
80 end
80 end
81
81
82 def test_issues_form_update
82 def test_issues_form_update
83 assert_routing(
83 assert_routing(
84 { :method => 'post', :path => "/projects/23/issues/new" },
84 { :method => 'post', :path => "/projects/23/issues/new" },
85 { :controller => 'issues', :action => 'new', :project_id => '23' }
85 { :controller => 'issues', :action => 'new', :project_id => '23' }
86 )
86 )
87 assert_routing(
87 assert_routing(
88 { :method => 'post', :path => "/projects/23/issues" },
88 { :method => 'post', :path => "/projects/23/issues" },
89 { :controller => 'issues', :action => 'create', :project_id => '23' }
89 { :controller => 'issues', :action => 'create', :project_id => '23' }
90 )
90 )
91 assert_routing(
91 assert_routing(
92 { :method => 'post', :path => "/issues.xml" },
92 { :method => 'post', :path => "/issues.xml" },
93 { :controller => 'issues', :action => 'create', :format => 'xml' }
93 { :controller => 'issues', :action => 'create', :format => 'xml' }
94 )
94 )
95 assert_routing(
95 assert_routing(
96 { :method => 'get', :path => "/issues/64/edit" },
96 { :method => 'get', :path => "/issues/64/edit" },
97 { :controller => 'issues', :action => 'edit', :id => '64' }
97 { :controller => 'issues', :action => 'edit', :id => '64' }
98 )
98 )
99 assert_routing(
99 assert_routing(
100 { :method => 'put', :path => "/issues/1.xml" },
100 { :method => 'put', :path => "/issues/1.xml" },
101 { :controller => 'issues', :action => 'update', :id => '1',
101 { :controller => 'issues', :action => 'update', :id => '1',
102 :format => 'xml' }
102 :format => 'xml' }
103 )
103 )
104 assert_routing(
104 assert_routing(
105 { :method => 'delete', :path => "/issues/1.xml" },
105 { :method => 'delete', :path => "/issues/1.xml" },
106 { :controller => 'issues', :action => 'destroy', :id => '1',
106 { :controller => 'issues', :action => 'destroy', :id => '1',
107 :format => 'xml' }
107 :format => 'xml' }
108 )
108 )
109 end
109 end
110
110
111 def test_issues_extra_actions
111 def test_issues_extra_actions
112 assert_routing(
112 assert_routing(
113 { :method => 'get', :path => "/projects/23/issues/64/copy" },
113 { :method => 'get', :path => "/projects/23/issues/64/copy" },
114 { :controller => 'issues', :action => 'new', :project_id => '23',
114 { :controller => 'issues', :action => 'new', :project_id => '23',
115 :copy_from => '64' }
115 :copy_from => '64' }
116 )
116 )
117 assert_routing(
117 assert_routing(
118 { :method => 'get', :path => "/issues/auto_complete" },
119 { :controller => 'auto_completes', :action => 'issues' }
120 )
121 assert_routing(
122 { :method => 'get', :path => "/issues/preview/123" },
118 { :method => 'get', :path => "/issues/preview/123" },
123 { :controller => 'previews', :action => 'issue', :id => '123' }
119 { :controller => 'previews', :action => 'issue', :id => '123' }
124 )
120 )
125 assert_routing(
121 assert_routing(
126 { :method => 'post', :path => "/issues/preview/123" },
122 { :method => 'post', :path => "/issues/preview/123" },
127 { :controller => 'previews', :action => 'issue', :id => '123' }
123 { :controller => 'previews', :action => 'issue', :id => '123' }
128 )
124 )
129 assert_routing(
125 assert_routing(
130 { :method => 'get', :path => "/issues/context_menu" },
126 { :method => 'get', :path => "/issues/context_menu" },
131 { :controller => 'context_menus', :action => 'issues' }
127 { :controller => 'context_menus', :action => 'issues' }
132 )
128 )
133 assert_routing(
129 assert_routing(
134 { :method => 'post', :path => "/issues/context_menu" },
130 { :method => 'post', :path => "/issues/context_menu" },
135 { :controller => 'context_menus', :action => 'issues' }
131 { :controller => 'context_menus', :action => 'issues' }
136 )
132 )
137 assert_routing(
133 assert_routing(
138 { :method => 'get', :path => "/issues/bulk_edit" },
134 { :method => 'get', :path => "/issues/bulk_edit" },
139 { :controller => 'issues', :action => 'bulk_edit' }
135 { :controller => 'issues', :action => 'bulk_edit' }
140 )
136 )
141 assert_routing(
137 assert_routing(
142 { :method => 'post', :path => "/issues/bulk_update" },
138 { :method => 'post', :path => "/issues/bulk_update" },
143 { :controller => 'issues', :action => 'bulk_update' }
139 { :controller => 'issues', :action => 'bulk_update' }
144 )
140 )
145 end
141 end
146
142
147 def test_issue_categories
143 def test_issue_categories
148 assert_routing(
144 assert_routing(
149 { :method => 'get', :path => "/projects/foo/issue_categories" },
145 { :method => 'get', :path => "/projects/foo/issue_categories" },
150 { :controller => 'issue_categories', :action => 'index',
146 { :controller => 'issue_categories', :action => 'index',
151 :project_id => 'foo' }
147 :project_id => 'foo' }
152 )
148 )
153 assert_routing(
149 assert_routing(
154 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
150 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
155 { :controller => 'issue_categories', :action => 'index',
151 { :controller => 'issue_categories', :action => 'index',
156 :project_id => 'foo', :format => 'xml' }
152 :project_id => 'foo', :format => 'xml' }
157 )
153 )
158 assert_routing(
154 assert_routing(
159 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
155 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
160 { :controller => 'issue_categories', :action => 'index',
156 { :controller => 'issue_categories', :action => 'index',
161 :project_id => 'foo', :format => 'json' }
157 :project_id => 'foo', :format => 'json' }
162 )
158 )
163 assert_routing(
159 assert_routing(
164 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
160 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
165 { :controller => 'issue_categories', :action => 'new',
161 { :controller => 'issue_categories', :action => 'new',
166 :project_id => 'foo' }
162 :project_id => 'foo' }
167 )
163 )
168 assert_routing(
164 assert_routing(
169 { :method => 'post', :path => "/projects/foo/issue_categories" },
165 { :method => 'post', :path => "/projects/foo/issue_categories" },
170 { :controller => 'issue_categories', :action => 'create',
166 { :controller => 'issue_categories', :action => 'create',
171 :project_id => 'foo' }
167 :project_id => 'foo' }
172 )
168 )
173 assert_routing(
169 assert_routing(
174 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
170 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
175 { :controller => 'issue_categories', :action => 'create',
171 { :controller => 'issue_categories', :action => 'create',
176 :project_id => 'foo', :format => 'xml' }
172 :project_id => 'foo', :format => 'xml' }
177 )
173 )
178 assert_routing(
174 assert_routing(
179 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
175 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
180 { :controller => 'issue_categories', :action => 'create',
176 { :controller => 'issue_categories', :action => 'create',
181 :project_id => 'foo', :format => 'json' }
177 :project_id => 'foo', :format => 'json' }
182 )
178 )
183 assert_routing(
179 assert_routing(
184 { :method => 'get', :path => "/issue_categories/1" },
180 { :method => 'get', :path => "/issue_categories/1" },
185 { :controller => 'issue_categories', :action => 'show', :id => '1' }
181 { :controller => 'issue_categories', :action => 'show', :id => '1' }
186 )
182 )
187 assert_routing(
183 assert_routing(
188 { :method => 'get', :path => "/issue_categories/1.xml" },
184 { :method => 'get', :path => "/issue_categories/1.xml" },
189 { :controller => 'issue_categories', :action => 'show', :id => '1',
185 { :controller => 'issue_categories', :action => 'show', :id => '1',
190 :format => 'xml' }
186 :format => 'xml' }
191 )
187 )
192 assert_routing(
188 assert_routing(
193 { :method => 'get', :path => "/issue_categories/1.json" },
189 { :method => 'get', :path => "/issue_categories/1.json" },
194 { :controller => 'issue_categories', :action => 'show', :id => '1',
190 { :controller => 'issue_categories', :action => 'show', :id => '1',
195 :format => 'json' }
191 :format => 'json' }
196 )
192 )
197 assert_routing(
193 assert_routing(
198 { :method => 'get', :path => "/issue_categories/1/edit" },
194 { :method => 'get', :path => "/issue_categories/1/edit" },
199 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
195 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
200 )
196 )
201 assert_routing(
197 assert_routing(
202 { :method => 'put', :path => "/issue_categories/1" },
198 { :method => 'put', :path => "/issue_categories/1" },
203 { :controller => 'issue_categories', :action => 'update', :id => '1' }
199 { :controller => 'issue_categories', :action => 'update', :id => '1' }
204 )
200 )
205 assert_routing(
201 assert_routing(
206 { :method => 'put', :path => "/issue_categories/1.xml" },
202 { :method => 'put', :path => "/issue_categories/1.xml" },
207 { :controller => 'issue_categories', :action => 'update', :id => '1',
203 { :controller => 'issue_categories', :action => 'update', :id => '1',
208 :format => 'xml' }
204 :format => 'xml' }
209 )
205 )
210 assert_routing(
206 assert_routing(
211 { :method => 'put', :path => "/issue_categories/1.json" },
207 { :method => 'put', :path => "/issue_categories/1.json" },
212 { :controller => 'issue_categories', :action => 'update', :id => '1',
208 { :controller => 'issue_categories', :action => 'update', :id => '1',
213 :format => 'json' }
209 :format => 'json' }
214 )
210 )
215 assert_routing(
211 assert_routing(
216 { :method => 'delete', :path => "/issue_categories/1" },
212 { :method => 'delete', :path => "/issue_categories/1" },
217 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
213 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
218 )
214 )
219 assert_routing(
215 assert_routing(
220 { :method => 'delete', :path => "/issue_categories/1.xml" },
216 { :method => 'delete', :path => "/issue_categories/1.xml" },
221 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
217 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
222 :format => 'xml' }
218 :format => 'xml' }
223 )
219 )
224 assert_routing(
220 assert_routing(
225 { :method => 'delete', :path => "/issue_categories/1.json" },
221 { :method => 'delete', :path => "/issue_categories/1.json" },
226 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
222 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
227 :format => 'json' }
223 :format => 'json' }
228 )
224 )
229 end
225 end
230
226
231 def test_news
227 def test_news
232 assert_routing(
228 assert_routing(
233 { :method => 'get', :path => "/news" },
229 { :method => 'get', :path => "/news" },
234 { :controller => 'news', :action => 'index' }
230 { :controller => 'news', :action => 'index' }
235 )
231 )
236 assert_routing(
232 assert_routing(
237 { :method => 'get', :path => "/news.atom" },
233 { :method => 'get', :path => "/news.atom" },
238 { :controller => 'news', :action => 'index', :format => 'atom' }
234 { :controller => 'news', :action => 'index', :format => 'atom' }
239 )
235 )
240 assert_routing(
236 assert_routing(
241 { :method => 'get', :path => "/news.xml" },
237 { :method => 'get', :path => "/news.xml" },
242 { :controller => 'news', :action => 'index', :format => 'xml' }
238 { :controller => 'news', :action => 'index', :format => 'xml' }
243 )
239 )
244 assert_routing(
240 assert_routing(
245 { :method => 'get', :path => "/news.json" },
241 { :method => 'get', :path => "/news.json" },
246 { :controller => 'news', :action => 'index', :format => 'json' }
242 { :controller => 'news', :action => 'index', :format => 'json' }
247 )
243 )
248 assert_routing(
244 assert_routing(
249 { :method => 'get', :path => "/projects/567/news" },
245 { :method => 'get', :path => "/projects/567/news" },
250 { :controller => 'news', :action => 'index', :project_id => '567' }
246 { :controller => 'news', :action => 'index', :project_id => '567' }
251 )
247 )
252 assert_routing(
248 assert_routing(
253 { :method => 'get', :path => "/projects/567/news.atom" },
249 { :method => 'get', :path => "/projects/567/news.atom" },
254 { :controller => 'news', :action => 'index', :format => 'atom',
250 { :controller => 'news', :action => 'index', :format => 'atom',
255 :project_id => '567' }
251 :project_id => '567' }
256 )
252 )
257 assert_routing(
253 assert_routing(
258 { :method => 'get', :path => "/projects/567/news.xml" },
254 { :method => 'get', :path => "/projects/567/news.xml" },
259 { :controller => 'news', :action => 'index', :format => 'xml',
255 { :controller => 'news', :action => 'index', :format => 'xml',
260 :project_id => '567' }
256 :project_id => '567' }
261 )
257 )
262 assert_routing(
258 assert_routing(
263 { :method => 'get', :path => "/projects/567/news.json" },
259 { :method => 'get', :path => "/projects/567/news.json" },
264 { :controller => 'news', :action => 'index', :format => 'json',
260 { :controller => 'news', :action => 'index', :format => 'json',
265 :project_id => '567' }
261 :project_id => '567' }
266 )
262 )
267 assert_routing(
263 assert_routing(
268 { :method => 'get', :path => "/news/2" },
264 { :method => 'get', :path => "/news/2" },
269 { :controller => 'news', :action => 'show', :id => '2' }
265 { :controller => 'news', :action => 'show', :id => '2' }
270 )
266 )
271 assert_routing(
267 assert_routing(
272 { :method => 'get', :path => "/projects/567/news/new" },
268 { :method => 'get', :path => "/projects/567/news/new" },
273 { :controller => 'news', :action => 'new', :project_id => '567' }
269 { :controller => 'news', :action => 'new', :project_id => '567' }
274 )
270 )
275 assert_routing(
271 assert_routing(
276 { :method => 'get', :path => "/news/234" },
272 { :method => 'get', :path => "/news/234" },
277 { :controller => 'news', :action => 'show', :id => '234' }
273 { :controller => 'news', :action => 'show', :id => '234' }
278 )
274 )
279 assert_routing(
275 assert_routing(
280 { :method => 'get', :path => "/news/567/edit" },
276 { :method => 'get', :path => "/news/567/edit" },
281 { :controller => 'news', :action => 'edit', :id => '567' }
277 { :controller => 'news', :action => 'edit', :id => '567' }
282 )
278 )
283 assert_routing(
279 assert_routing(
284 { :method => 'get', :path => "/news/preview" },
280 { :method => 'get', :path => "/news/preview" },
285 { :controller => 'previews', :action => 'news' }
281 { :controller => 'previews', :action => 'news' }
286 )
282 )
287 assert_routing(
283 assert_routing(
288 { :method => 'post', :path => "/projects/567/news" },
284 { :method => 'post', :path => "/projects/567/news" },
289 { :controller => 'news', :action => 'create', :project_id => '567' }
285 { :controller => 'news', :action => 'create', :project_id => '567' }
290 )
286 )
291 assert_routing(
287 assert_routing(
292 { :method => 'post', :path => "/news/567/comments" },
288 { :method => 'post', :path => "/news/567/comments" },
293 { :controller => 'comments', :action => 'create', :id => '567' }
289 { :controller => 'comments', :action => 'create', :id => '567' }
294 )
290 )
295 assert_routing(
291 assert_routing(
296 { :method => 'put', :path => "/news/567" },
292 { :method => 'put', :path => "/news/567" },
297 { :controller => 'news', :action => 'update', :id => '567' }
293 { :controller => 'news', :action => 'update', :id => '567' }
298 )
294 )
299 assert_routing(
295 assert_routing(
300 { :method => 'delete', :path => "/news/567" },
296 { :method => 'delete', :path => "/news/567" },
301 { :controller => 'news', :action => 'destroy', :id => '567' }
297 { :controller => 'news', :action => 'destroy', :id => '567' }
302 )
298 )
303 assert_routing(
299 assert_routing(
304 { :method => 'delete', :path => "/news/567/comments/15" },
300 { :method => 'delete', :path => "/news/567/comments/15" },
305 { :controller => 'comments', :action => 'destroy', :id => '567',
301 { :controller => 'comments', :action => 'destroy', :id => '567',
306 :comment_id => '15' }
302 :comment_id => '15' }
307 )
303 )
308 end
304 end
309
305
310 def test_projects
306 def test_projects
311 assert_routing(
307 assert_routing(
312 { :method => 'get', :path => "/projects" },
308 { :method => 'get', :path => "/projects" },
313 { :controller => 'projects', :action => 'index' }
309 { :controller => 'projects', :action => 'index' }
314 )
310 )
315 assert_routing(
311 assert_routing(
316 { :method => 'get', :path => "/projects.atom" },
312 { :method => 'get', :path => "/projects.atom" },
317 { :controller => 'projects', :action => 'index', :format => 'atom' }
313 { :controller => 'projects', :action => 'index', :format => 'atom' }
318 )
314 )
319 assert_routing(
315 assert_routing(
320 { :method => 'get', :path => "/projects.xml" },
316 { :method => 'get', :path => "/projects.xml" },
321 { :controller => 'projects', :action => 'index', :format => 'xml' }
317 { :controller => 'projects', :action => 'index', :format => 'xml' }
322 )
318 )
323 assert_routing(
319 assert_routing(
324 { :method => 'get', :path => "/projects/new" },
320 { :method => 'get', :path => "/projects/new" },
325 { :controller => 'projects', :action => 'new' }
321 { :controller => 'projects', :action => 'new' }
326 )
322 )
327 assert_routing(
323 assert_routing(
328 { :method => 'get', :path => "/projects/test" },
324 { :method => 'get', :path => "/projects/test" },
329 { :controller => 'projects', :action => 'show', :id => 'test' }
325 { :controller => 'projects', :action => 'show', :id => 'test' }
330 )
326 )
331 assert_routing(
327 assert_routing(
332 { :method => 'get', :path => "/projects/1.xml" },
328 { :method => 'get', :path => "/projects/1.xml" },
333 { :controller => 'projects', :action => 'show', :id => '1',
329 { :controller => 'projects', :action => 'show', :id => '1',
334 :format => 'xml' }
330 :format => 'xml' }
335 )
331 )
336 assert_routing(
332 assert_routing(
337 { :method => 'get', :path => "/projects/4223/settings" },
333 { :method => 'get', :path => "/projects/4223/settings" },
338 { :controller => 'projects', :action => 'settings', :id => '4223' }
334 { :controller => 'projects', :action => 'settings', :id => '4223' }
339 )
335 )
340 assert_routing(
336 assert_routing(
341 { :method => 'get', :path => "/projects/4223/settings/members" },
337 { :method => 'get', :path => "/projects/4223/settings/members" },
342 { :controller => 'projects', :action => 'settings', :id => '4223',
338 { :controller => 'projects', :action => 'settings', :id => '4223',
343 :tab => 'members' }
339 :tab => 'members' }
344 )
340 )
345 assert_routing(
341 assert_routing(
346 { :method => 'get', :path => "/projects/33/roadmap" },
342 { :method => 'get', :path => "/projects/33/roadmap" },
347 { :controller => 'versions', :action => 'index', :project_id => '33' }
343 { :controller => 'versions', :action => 'index', :project_id => '33' }
348 )
344 )
349 assert_routing(
345 assert_routing(
350 { :method => 'post', :path => "/projects" },
346 { :method => 'post', :path => "/projects" },
351 { :controller => 'projects', :action => 'create' }
347 { :controller => 'projects', :action => 'create' }
352 )
348 )
353 assert_routing(
349 assert_routing(
354 { :method => 'post', :path => "/projects.xml" },
350 { :method => 'post', :path => "/projects.xml" },
355 { :controller => 'projects', :action => 'create', :format => 'xml' }
351 { :controller => 'projects', :action => 'create', :format => 'xml' }
356 )
352 )
357 assert_routing(
353 assert_routing(
358 { :method => 'post', :path => "/projects/64/archive" },
354 { :method => 'post', :path => "/projects/64/archive" },
359 { :controller => 'projects', :action => 'archive', :id => '64' }
355 { :controller => 'projects', :action => 'archive', :id => '64' }
360 )
356 )
361 assert_routing(
357 assert_routing(
362 { :method => 'post', :path => "/projects/64/unarchive" },
358 { :method => 'post', :path => "/projects/64/unarchive" },
363 { :controller => 'projects', :action => 'unarchive', :id => '64' }
359 { :controller => 'projects', :action => 'unarchive', :id => '64' }
364 )
360 )
365 assert_routing(
361 assert_routing(
366 { :method => 'put', :path => "/projects/64/enumerations" },
362 { :method => 'put', :path => "/projects/64/enumerations" },
367 { :controller => 'project_enumerations', :action => 'update',
363 { :controller => 'project_enumerations', :action => 'update',
368 :project_id => '64' }
364 :project_id => '64' }
369 )
365 )
370 assert_routing(
366 assert_routing(
371 { :method => 'put', :path => "/projects/4223" },
367 { :method => 'put', :path => "/projects/4223" },
372 { :controller => 'projects', :action => 'update', :id => '4223' }
368 { :controller => 'projects', :action => 'update', :id => '4223' }
373 )
369 )
374 assert_routing(
370 assert_routing(
375 { :method => 'put', :path => "/projects/1.xml" },
371 { :method => 'put', :path => "/projects/1.xml" },
376 { :controller => 'projects', :action => 'update', :id => '1',
372 { :controller => 'projects', :action => 'update', :id => '1',
377 :format => 'xml' }
373 :format => 'xml' }
378 )
374 )
379 assert_routing(
375 assert_routing(
380 { :method => 'delete', :path => "/projects/64" },
376 { :method => 'delete', :path => "/projects/64" },
381 { :controller => 'projects', :action => 'destroy', :id => '64' }
377 { :controller => 'projects', :action => 'destroy', :id => '64' }
382 )
378 )
383 assert_routing(
379 assert_routing(
384 { :method => 'delete', :path => "/projects/1.xml" },
380 { :method => 'delete', :path => "/projects/1.xml" },
385 { :controller => 'projects', :action => 'destroy', :id => '1',
381 { :controller => 'projects', :action => 'destroy', :id => '1',
386 :format => 'xml' }
382 :format => 'xml' }
387 )
383 )
388 assert_routing(
384 assert_routing(
389 { :method => 'delete', :path => "/projects/64/enumerations" },
385 { :method => 'delete', :path => "/projects/64/enumerations" },
390 { :controller => 'project_enumerations', :action => 'destroy',
386 { :controller => 'project_enumerations', :action => 'destroy',
391 :project_id => '64' }
387 :project_id => '64' }
392 )
388 )
393 end
389 end
394
390
395 def test_queries
391 def test_queries
396 assert_routing(
392 assert_routing(
397 { :method => 'get', :path => "/queries.xml" },
393 { :method => 'get', :path => "/queries.xml" },
398 { :controller => 'queries', :action => 'index', :format => 'xml' }
394 { :controller => 'queries', :action => 'index', :format => 'xml' }
399 )
395 )
400 assert_routing(
396 assert_routing(
401 { :method => 'get', :path => "/queries.json" },
397 { :method => 'get', :path => "/queries.json" },
402 { :controller => 'queries', :action => 'index', :format => 'json' }
398 { :controller => 'queries', :action => 'index', :format => 'json' }
403 )
399 )
404 assert_routing(
400 assert_routing(
405 { :method => 'get', :path => "/queries/new" },
401 { :method => 'get', :path => "/queries/new" },
406 { :controller => 'queries', :action => 'new' }
402 { :controller => 'queries', :action => 'new' }
407 )
403 )
408 assert_routing(
404 assert_routing(
409 { :method => 'get', :path => "/projects/redmine/queries/new" },
405 { :method => 'get', :path => "/projects/redmine/queries/new" },
410 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
406 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
411 )
407 )
412 assert_routing(
408 assert_routing(
413 { :method => 'post', :path => "/queries" },
409 { :method => 'post', :path => "/queries" },
414 { :controller => 'queries', :action => 'create' }
410 { :controller => 'queries', :action => 'create' }
415 )
411 )
416 assert_routing(
412 assert_routing(
417 { :method => 'post', :path => "/projects/redmine/queries" },
413 { :method => 'post', :path => "/projects/redmine/queries" },
418 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
414 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
419 )
415 )
420 assert_routing(
416 assert_routing(
421 { :method => 'get', :path => "/queries/1/edit" },
417 { :method => 'get', :path => "/queries/1/edit" },
422 { :controller => 'queries', :action => 'edit', :id => '1' }
418 { :controller => 'queries', :action => 'edit', :id => '1' }
423 )
419 )
424 assert_routing(
420 assert_routing(
425 { :method => 'put', :path => "/queries/1" },
421 { :method => 'put', :path => "/queries/1" },
426 { :controller => 'queries', :action => 'update', :id => '1' }
422 { :controller => 'queries', :action => 'update', :id => '1' }
427 )
423 )
428 assert_routing(
424 assert_routing(
429 { :method => 'delete', :path => "/queries/1" },
425 { :method => 'delete', :path => "/queries/1" },
430 { :controller => 'queries', :action => 'destroy', :id => '1' }
426 { :controller => 'queries', :action => 'destroy', :id => '1' }
431 )
427 )
432 end
428 end
433
429
434 def test_roles
430 def test_roles
435 assert_routing(
431 assert_routing(
436 { :method => 'get', :path => "/roles" },
432 { :method => 'get', :path => "/roles" },
437 { :controller => 'roles', :action => 'index' }
433 { :controller => 'roles', :action => 'index' }
438 )
434 )
439 assert_routing(
435 assert_routing(
440 { :method => 'get', :path => "/roles/new" },
436 { :method => 'get', :path => "/roles/new" },
441 { :controller => 'roles', :action => 'new' }
437 { :controller => 'roles', :action => 'new' }
442 )
438 )
443 assert_routing(
439 assert_routing(
444 { :method => 'post', :path => "/roles" },
440 { :method => 'post', :path => "/roles" },
445 { :controller => 'roles', :action => 'create' }
441 { :controller => 'roles', :action => 'create' }
446 )
442 )
447 assert_routing(
443 assert_routing(
448 { :method => 'get', :path => "/roles/2/edit" },
444 { :method => 'get', :path => "/roles/2/edit" },
449 { :controller => 'roles', :action => 'edit', :id => '2' }
445 { :controller => 'roles', :action => 'edit', :id => '2' }
450 )
446 )
451 assert_routing(
447 assert_routing(
452 { :method => 'put', :path => "/roles/2" },
448 { :method => 'put', :path => "/roles/2" },
453 { :controller => 'roles', :action => 'update', :id => '2' }
449 { :controller => 'roles', :action => 'update', :id => '2' }
454 )
450 )
455 assert_routing(
451 assert_routing(
456 { :method => 'delete', :path => "/roles/2" },
452 { :method => 'delete', :path => "/roles/2" },
457 { :controller => 'roles', :action => 'destroy', :id => '2' }
453 { :controller => 'roles', :action => 'destroy', :id => '2' }
458 )
454 )
459 assert_routing(
455 assert_routing(
460 { :method => 'get', :path => "/roles/permissions" },
456 { :method => 'get', :path => "/roles/permissions" },
461 { :controller => 'roles', :action => 'permissions' }
457 { :controller => 'roles', :action => 'permissions' }
462 )
458 )
463 assert_routing(
459 assert_routing(
464 { :method => 'post', :path => "/roles/permissions" },
460 { :method => 'post', :path => "/roles/permissions" },
465 { :controller => 'roles', :action => 'permissions' }
461 { :controller => 'roles', :action => 'permissions' }
466 )
462 )
467 end
463 end
468
464
469 def test_users
465 def test_users
470 assert_routing(
466 assert_routing(
471 { :method => 'get', :path => "/users" },
467 { :method => 'get', :path => "/users" },
472 { :controller => 'users', :action => 'index' }
468 { :controller => 'users', :action => 'index' }
473 )
469 )
474 assert_routing(
470 assert_routing(
475 { :method => 'get', :path => "/users.xml" },
471 { :method => 'get', :path => "/users.xml" },
476 { :controller => 'users', :action => 'index', :format => 'xml' }
472 { :controller => 'users', :action => 'index', :format => 'xml' }
477 )
473 )
478 assert_routing(
474 assert_routing(
479 { :method => 'get', :path => "/users/44" },
475 { :method => 'get', :path => "/users/44" },
480 { :controller => 'users', :action => 'show', :id => '44' }
476 { :controller => 'users', :action => 'show', :id => '44' }
481 )
477 )
482 assert_routing(
478 assert_routing(
483 { :method => 'get', :path => "/users/44.xml" },
479 { :method => 'get', :path => "/users/44.xml" },
484 { :controller => 'users', :action => 'show', :id => '44',
480 { :controller => 'users', :action => 'show', :id => '44',
485 :format => 'xml' }
481 :format => 'xml' }
486 )
482 )
487 assert_routing(
483 assert_routing(
488 { :method => 'get', :path => "/users/current" },
484 { :method => 'get', :path => "/users/current" },
489 { :controller => 'users', :action => 'show', :id => 'current' }
485 { :controller => 'users', :action => 'show', :id => 'current' }
490 )
486 )
491 assert_routing(
487 assert_routing(
492 { :method => 'get', :path => "/users/current.xml" },
488 { :method => 'get', :path => "/users/current.xml" },
493 { :controller => 'users', :action => 'show', :id => 'current',
489 { :controller => 'users', :action => 'show', :id => 'current',
494 :format => 'xml' }
490 :format => 'xml' }
495 )
491 )
496 assert_routing(
492 assert_routing(
497 { :method => 'get', :path => "/users/new" },
493 { :method => 'get', :path => "/users/new" },
498 { :controller => 'users', :action => 'new' }
494 { :controller => 'users', :action => 'new' }
499 )
495 )
500 assert_routing(
496 assert_routing(
501 { :method => 'get', :path => "/users/444/edit" },
497 { :method => 'get', :path => "/users/444/edit" },
502 { :controller => 'users', :action => 'edit', :id => '444' }
498 { :controller => 'users', :action => 'edit', :id => '444' }
503 )
499 )
504 assert_routing(
500 assert_routing(
505 { :method => 'post', :path => "/users" },
501 { :method => 'post', :path => "/users" },
506 { :controller => 'users', :action => 'create' }
502 { :controller => 'users', :action => 'create' }
507 )
503 )
508 assert_routing(
504 assert_routing(
509 { :method => 'post', :path => "/users.xml" },
505 { :method => 'post', :path => "/users.xml" },
510 { :controller => 'users', :action => 'create', :format => 'xml' }
506 { :controller => 'users', :action => 'create', :format => 'xml' }
511 )
507 )
512 assert_routing(
508 assert_routing(
513 { :method => 'put', :path => "/users/444" },
509 { :method => 'put', :path => "/users/444" },
514 { :controller => 'users', :action => 'update', :id => '444' }
510 { :controller => 'users', :action => 'update', :id => '444' }
515 )
511 )
516 assert_routing(
512 assert_routing(
517 { :method => 'put', :path => "/users/444.xml" },
513 { :method => 'put', :path => "/users/444.xml" },
518 { :controller => 'users', :action => 'update', :id => '444',
514 { :controller => 'users', :action => 'update', :id => '444',
519 :format => 'xml' }
515 :format => 'xml' }
520 )
516 )
521 assert_routing(
517 assert_routing(
522 { :method => 'delete', :path => "/users/44" },
518 { :method => 'delete', :path => "/users/44" },
523 { :controller => 'users', :action => 'destroy', :id => '44' }
519 { :controller => 'users', :action => 'destroy', :id => '44' }
524 )
520 )
525 assert_routing(
521 assert_routing(
526 { :method => 'delete', :path => "/users/44.xml" },
522 { :method => 'delete', :path => "/users/44.xml" },
527 { :controller => 'users', :action => 'destroy', :id => '44',
523 { :controller => 'users', :action => 'destroy', :id => '44',
528 :format => 'xml' }
524 :format => 'xml' }
529 )
525 )
530 assert_routing(
526 assert_routing(
531 { :method => 'post', :path => "/users/123/memberships" },
527 { :method => 'post', :path => "/users/123/memberships" },
532 { :controller => 'users', :action => 'edit_membership',
528 { :controller => 'users', :action => 'edit_membership',
533 :id => '123' }
529 :id => '123' }
534 )
530 )
535 assert_routing(
531 assert_routing(
536 { :method => 'put', :path => "/users/123/memberships/55" },
532 { :method => 'put', :path => "/users/123/memberships/55" },
537 { :controller => 'users', :action => 'edit_membership',
533 { :controller => 'users', :action => 'edit_membership',
538 :id => '123', :membership_id => '55' }
534 :id => '123', :membership_id => '55' }
539 )
535 )
540 assert_routing(
536 assert_routing(
541 { :method => 'delete', :path => "/users/123/memberships/55" },
537 { :method => 'delete', :path => "/users/123/memberships/55" },
542 { :controller => 'users', :action => 'destroy_membership',
538 { :controller => 'users', :action => 'destroy_membership',
543 :id => '123', :membership_id => '55' }
539 :id => '123', :membership_id => '55' }
544 )
540 )
545 end
541 end
546
542
547 def test_welcome
543 def test_welcome
548 assert_routing(
544 assert_routing(
549 { :method => 'get', :path => "/robots.txt" },
545 { :method => 'get', :path => "/robots.txt" },
550 { :controller => 'welcome', :action => 'robots' }
546 { :controller => 'welcome', :action => 'robots' }
551 )
547 )
552 end
548 end
553
549
554 def test_wiki_singular_projects_pages
550 def test_wiki_singular_projects_pages
555 assert_routing(
551 assert_routing(
556 { :method => 'get', :path => "/projects/567/wiki" },
552 { :method => 'get', :path => "/projects/567/wiki" },
557 { :controller => 'wiki', :action => 'show', :project_id => '567' }
553 { :controller => 'wiki', :action => 'show', :project_id => '567' }
558 )
554 )
559 assert_routing(
555 assert_routing(
560 { :method => 'get', :path => "/projects/567/wiki/lalala" },
556 { :method => 'get', :path => "/projects/567/wiki/lalala" },
561 { :controller => 'wiki', :action => 'show', :project_id => '567',
557 { :controller => 'wiki', :action => 'show', :project_id => '567',
562 :id => 'lalala' }
558 :id => 'lalala' }
563 )
559 )
564 assert_routing(
560 assert_routing(
565 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
561 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
566 { :controller => 'wiki', :action => 'edit', :project_id => '567',
562 { :controller => 'wiki', :action => 'edit', :project_id => '567',
567 :id => 'my_page' }
563 :id => 'my_page' }
568 )
564 )
569 assert_routing(
565 assert_routing(
570 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
566 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
571 { :controller => 'wiki', :action => 'history', :project_id => '1',
567 { :controller => 'wiki', :action => 'history', :project_id => '1',
572 :id => 'CookBook_documentation' }
568 :id => 'CookBook_documentation' }
573 )
569 )
574 assert_routing(
570 assert_routing(
575 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
571 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
576 { :controller => 'wiki', :action => 'diff', :project_id => '1',
572 { :controller => 'wiki', :action => 'diff', :project_id => '1',
577 :id => 'CookBook_documentation' }
573 :id => 'CookBook_documentation' }
578 )
574 )
579 assert_routing(
575 assert_routing(
580 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
576 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
581 { :controller => 'wiki', :action => 'diff', :project_id => '1',
577 { :controller => 'wiki', :action => 'diff', :project_id => '1',
582 :id => 'CookBook_documentation', :version => '2' }
578 :id => 'CookBook_documentation', :version => '2' }
583 )
579 )
584 assert_routing(
580 assert_routing(
585 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
581 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
586 { :controller => 'wiki', :action => 'diff', :project_id => '1',
582 { :controller => 'wiki', :action => 'diff', :project_id => '1',
587 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
583 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
588 )
584 )
589 assert_routing(
585 assert_routing(
590 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
586 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
591 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
587 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
592 :id => 'CookBook_documentation', :version => '2' }
588 :id => 'CookBook_documentation', :version => '2' }
593 )
589 )
594 assert_routing(
590 assert_routing(
595 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
591 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
596 { :controller => 'wiki', :action => 'rename', :project_id => '22',
592 { :controller => 'wiki', :action => 'rename', :project_id => '22',
597 :id => 'ladida' }
593 :id => 'ladida' }
598 )
594 )
599 assert_routing(
595 assert_routing(
600 { :method => 'get', :path => "/projects/567/wiki/index" },
596 { :method => 'get', :path => "/projects/567/wiki/index" },
601 { :controller => 'wiki', :action => 'index', :project_id => '567' }
597 { :controller => 'wiki', :action => 'index', :project_id => '567' }
602 )
598 )
603 assert_routing(
599 assert_routing(
604 { :method => 'get', :path => "/projects/567/wiki/date_index" },
600 { :method => 'get', :path => "/projects/567/wiki/date_index" },
605 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
601 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
606 )
602 )
607 assert_routing(
603 assert_routing(
608 { :method => 'get', :path => "/projects/567/wiki/export" },
604 { :method => 'get', :path => "/projects/567/wiki/export" },
609 { :controller => 'wiki', :action => 'export', :project_id => '567' }
605 { :controller => 'wiki', :action => 'export', :project_id => '567' }
610 )
606 )
611 assert_routing(
607 assert_routing(
612 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
608 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
613 { :controller => 'wiki', :action => 'preview', :project_id => '567',
609 { :controller => 'wiki', :action => 'preview', :project_id => '567',
614 :id => 'CookBook_documentation' }
610 :id => 'CookBook_documentation' }
615 )
611 )
616 assert_routing(
612 assert_routing(
617 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
613 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
618 { :controller => 'wiki', :action => 'rename', :project_id => '22',
614 { :controller => 'wiki', :action => 'rename', :project_id => '22',
619 :id => 'ladida' }
615 :id => 'ladida' }
620 )
616 )
621 assert_routing(
617 assert_routing(
622 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
618 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
623 { :controller => 'wiki', :action => 'protect', :project_id => '22',
619 { :controller => 'wiki', :action => 'protect', :project_id => '22',
624 :id => 'ladida' }
620 :id => 'ladida' }
625 )
621 )
626 assert_routing(
622 assert_routing(
627 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
623 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
628 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
624 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
629 :id => 'ladida' }
625 :id => 'ladida' }
630 )
626 )
631 assert_routing(
627 assert_routing(
632 { :method => 'put', :path => "/projects/567/wiki/my_page" },
628 { :method => 'put', :path => "/projects/567/wiki/my_page" },
633 { :controller => 'wiki', :action => 'update', :project_id => '567',
629 { :controller => 'wiki', :action => 'update', :project_id => '567',
634 :id => 'my_page' }
630 :id => 'my_page' }
635 )
631 )
636 assert_routing(
632 assert_routing(
637 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
633 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
638 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
634 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
639 :id => 'ladida' }
635 :id => 'ladida' }
640 )
636 )
641 end
637 end
642
638
643 def test_wikis_plural_admin_setup
639 def test_wikis_plural_admin_setup
644 assert_routing(
640 assert_routing(
645 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
641 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
646 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
642 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
647 )
643 )
648 assert_routing(
644 assert_routing(
649 { :method => 'post', :path => "/projects/ladida/wiki" },
645 { :method => 'post', :path => "/projects/ladida/wiki" },
650 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
646 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
651 )
647 )
652 assert_routing(
648 assert_routing(
653 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
649 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
654 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
650 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
655 )
651 )
656 end
652 end
657 end
653 end
General Comments 0
You need to be logged in to leave comments. Login now