##// END OF EJS Templates
test: route: move messages test to new file...
Toshi MARUYAMA -
r8203:413d98ca43fd
parent child
Show More
@@ -0,0 +1,56
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 RoutingMessagesTest < ActionController::IntegrationTest
21 def test_messages
22 assert_routing(
23 { :method => 'get', :path => "/boards/22/topics/2" },
24 { :controller => 'messages', :action => 'show', :id => '2',
25 :board_id => '22' }
26 )
27 assert_routing(
28 { :method => 'get', :path => "/boards/lala/topics/new" },
29 { :controller => 'messages', :action => 'new', :board_id => 'lala' }
30 )
31 assert_routing(
32 { :method => 'get', :path => "/boards/lala/topics/22/edit" },
33 { :controller => 'messages', :action => 'edit', :id => '22',
34 :board_id => 'lala' }
35 )
36 assert_routing(
37 { :method => 'post', :path => "/boards/lala/topics/new" },
38 { :controller => 'messages', :action => 'new', :board_id => 'lala' }
39 )
40 assert_routing(
41 { :method => 'post', :path => "/boards/lala/topics/22/edit" },
42 { :controller => 'messages', :action => 'edit', :id => '22',
43 :board_id => 'lala' }
44 )
45 assert_routing(
46 { :method => 'post', :path => "/boards/22/topics/555/replies" },
47 { :controller => 'messages', :action => 'reply', :id => '555',
48 :board_id => '22' }
49 )
50 assert_routing(
51 { :method => 'post', :path => "/boards/22/topics/555/destroy" },
52 { :controller => 'messages', :action => 'destroy', :id => '555',
53 :board_id => '22' }
54 )
55 end
56 end
@@ -1,1289 +1,1253
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_documents
21 def test_documents
22 assert_routing(
22 assert_routing(
23 { :method => 'get', :path => "/projects/567/documents" },
23 { :method => 'get', :path => "/projects/567/documents" },
24 { :controller => 'documents', :action => 'index', :project_id => '567' }
24 { :controller => 'documents', :action => 'index', :project_id => '567' }
25 )
25 )
26 assert_routing(
26 assert_routing(
27 { :method => 'get', :path => "/projects/567/documents/new" },
27 { :method => 'get', :path => "/projects/567/documents/new" },
28 { :controller => 'documents', :action => 'new', :project_id => '567' }
28 { :controller => 'documents', :action => 'new', :project_id => '567' }
29 )
29 )
30 assert_routing(
30 assert_routing(
31 { :method => 'get', :path => "/documents/22" },
31 { :method => 'get', :path => "/documents/22" },
32 { :controller => 'documents', :action => 'show', :id => '22' }
32 { :controller => 'documents', :action => 'show', :id => '22' }
33 )
33 )
34 assert_routing(
34 assert_routing(
35 { :method => 'get', :path => "/documents/22/edit" },
35 { :method => 'get', :path => "/documents/22/edit" },
36 { :controller => 'documents', :action => 'edit', :id => '22' }
36 { :controller => 'documents', :action => 'edit', :id => '22' }
37 )
37 )
38 assert_routing(
38 assert_routing(
39 { :method => 'post', :path => "/projects/567/documents" },
39 { :method => 'post', :path => "/projects/567/documents" },
40 { :controller => 'documents', :action => 'create', :project_id => '567' }
40 { :controller => 'documents', :action => 'create', :project_id => '567' }
41 )
41 )
42 assert_routing(
42 assert_routing(
43 { :method => 'put', :path => "/documents/22" },
43 { :method => 'put', :path => "/documents/22" },
44 { :controller => 'documents', :action => 'update', :id => '22' }
44 { :controller => 'documents', :action => 'update', :id => '22' }
45 )
45 )
46 assert_routing(
46 assert_routing(
47 { :method => 'delete', :path => "/documents/22" },
47 { :method => 'delete', :path => "/documents/22" },
48 { :controller => 'documents', :action => 'destroy', :id => '22' }
48 { :controller => 'documents', :action => 'destroy', :id => '22' }
49 )
49 )
50 assert_routing(
50 assert_routing(
51 { :method => 'post', :path => "/documents/22/add_attachment" },
51 { :method => 'post', :path => "/documents/22/add_attachment" },
52 { :controller => 'documents', :action => 'add_attachment', :id => '22' }
52 { :controller => 'documents', :action => 'add_attachment', :id => '22' }
53 )
53 )
54 end
54 end
55
55
56 def test_roles
56 def test_roles
57 assert_routing(
57 assert_routing(
58 { :method => 'get', :path => "/enumerations" },
58 { :method => 'get', :path => "/enumerations" },
59 { :controller => 'enumerations', :action => 'index' }
59 { :controller => 'enumerations', :action => 'index' }
60 )
60 )
61 assert_routing(
61 assert_routing(
62 { :method => 'get', :path => "/enumerations/new" },
62 { :method => 'get', :path => "/enumerations/new" },
63 { :controller => 'enumerations', :action => 'new' }
63 { :controller => 'enumerations', :action => 'new' }
64 )
64 )
65 assert_routing(
65 assert_routing(
66 { :method => 'post', :path => "/enumerations" },
66 { :method => 'post', :path => "/enumerations" },
67 { :controller => 'enumerations', :action => 'create' }
67 { :controller => 'enumerations', :action => 'create' }
68 )
68 )
69 assert_routing(
69 assert_routing(
70 { :method => 'get', :path => "/enumerations/2/edit" },
70 { :method => 'get', :path => "/enumerations/2/edit" },
71 { :controller => 'enumerations', :action => 'edit', :id => '2' }
71 { :controller => 'enumerations', :action => 'edit', :id => '2' }
72 )
72 )
73 assert_routing(
73 assert_routing(
74 { :method => 'put', :path => "/enumerations/2" },
74 { :method => 'put', :path => "/enumerations/2" },
75 { :controller => 'enumerations', :action => 'update', :id => '2' }
75 { :controller => 'enumerations', :action => 'update', :id => '2' }
76 )
76 )
77 assert_routing(
77 assert_routing(
78 { :method => 'delete', :path => "/enumerations/2" },
78 { :method => 'delete', :path => "/enumerations/2" },
79 { :controller => 'enumerations', :action => 'destroy', :id => '2' }
79 { :controller => 'enumerations', :action => 'destroy', :id => '2' }
80 )
80 )
81 end
81 end
82
82
83 def test_groups
83 def test_groups
84 assert_routing(
84 assert_routing(
85 { :method => 'post', :path => "/groups/567/users" },
85 { :method => 'post', :path => "/groups/567/users" },
86 { :controller => 'groups', :action => 'add_users', :id => '567' }
86 { :controller => 'groups', :action => 'add_users', :id => '567' }
87 )
87 )
88 assert_routing(
88 assert_routing(
89 { :method => 'delete', :path => "/groups/567/users/12" },
89 { :method => 'delete', :path => "/groups/567/users/12" },
90 { :controller => 'groups', :action => 'remove_user', :id => '567',
90 { :controller => 'groups', :action => 'remove_user', :id => '567',
91 :user_id => '12' }
91 :user_id => '12' }
92 )
92 )
93 end
93 end
94
94
95 def test_issues_rest_actions
95 def test_issues_rest_actions
96 assert_routing(
96 assert_routing(
97 { :method => 'get', :path => "/issues" },
97 { :method => 'get', :path => "/issues" },
98 { :controller => 'issues', :action => 'index' }
98 { :controller => 'issues', :action => 'index' }
99 )
99 )
100 assert_routing(
100 assert_routing(
101 { :method => 'get', :path => "/issues.pdf" },
101 { :method => 'get', :path => "/issues.pdf" },
102 { :controller => 'issues', :action => 'index', :format => 'pdf' }
102 { :controller => 'issues', :action => 'index', :format => 'pdf' }
103 )
103 )
104 assert_routing(
104 assert_routing(
105 { :method => 'get', :path => "/issues.atom" },
105 { :method => 'get', :path => "/issues.atom" },
106 { :controller => 'issues', :action => 'index', :format => 'atom' }
106 { :controller => 'issues', :action => 'index', :format => 'atom' }
107 )
107 )
108 assert_routing(
108 assert_routing(
109 { :method => 'get', :path => "/issues.xml" },
109 { :method => 'get', :path => "/issues.xml" },
110 { :controller => 'issues', :action => 'index', :format => 'xml' }
110 { :controller => 'issues', :action => 'index', :format => 'xml' }
111 )
111 )
112 assert_routing(
112 assert_routing(
113 { :method => 'get', :path => "/projects/23/issues" },
113 { :method => 'get', :path => "/projects/23/issues" },
114 { :controller => 'issues', :action => 'index', :project_id => '23' }
114 { :controller => 'issues', :action => 'index', :project_id => '23' }
115 )
115 )
116 assert_routing(
116 assert_routing(
117 { :method => 'get', :path => "/projects/23/issues.pdf" },
117 { :method => 'get', :path => "/projects/23/issues.pdf" },
118 { :controller => 'issues', :action => 'index', :project_id => '23',
118 { :controller => 'issues', :action => 'index', :project_id => '23',
119 :format => 'pdf' }
119 :format => 'pdf' }
120 )
120 )
121 assert_routing(
121 assert_routing(
122 { :method => 'get', :path => "/projects/23/issues.atom" },
122 { :method => 'get', :path => "/projects/23/issues.atom" },
123 { :controller => 'issues', :action => 'index', :project_id => '23',
123 { :controller => 'issues', :action => 'index', :project_id => '23',
124 :format => 'atom' }
124 :format => 'atom' }
125 )
125 )
126 assert_routing(
126 assert_routing(
127 { :method => 'get', :path => "/projects/23/issues.xml" },
127 { :method => 'get', :path => "/projects/23/issues.xml" },
128 { :controller => 'issues', :action => 'index', :project_id => '23',
128 { :controller => 'issues', :action => 'index', :project_id => '23',
129 :format => 'xml' }
129 :format => 'xml' }
130 )
130 )
131 assert_routing(
131 assert_routing(
132 { :method => 'get', :path => "/issues/64" },
132 { :method => 'get', :path => "/issues/64" },
133 { :controller => 'issues', :action => 'show', :id => '64' }
133 { :controller => 'issues', :action => 'show', :id => '64' }
134 )
134 )
135 assert_routing(
135 assert_routing(
136 { :method => 'get', :path => "/issues/64.pdf" },
136 { :method => 'get', :path => "/issues/64.pdf" },
137 { :controller => 'issues', :action => 'show', :id => '64',
137 { :controller => 'issues', :action => 'show', :id => '64',
138 :format => 'pdf' }
138 :format => 'pdf' }
139 )
139 )
140 assert_routing(
140 assert_routing(
141 { :method => 'get', :path => "/issues/64.atom" },
141 { :method => 'get', :path => "/issues/64.atom" },
142 { :controller => 'issues', :action => 'show', :id => '64',
142 { :controller => 'issues', :action => 'show', :id => '64',
143 :format => 'atom' }
143 :format => 'atom' }
144 )
144 )
145 assert_routing(
145 assert_routing(
146 { :method => 'get', :path => "/issues/64.xml" },
146 { :method => 'get', :path => "/issues/64.xml" },
147 { :controller => 'issues', :action => 'show', :id => '64',
147 { :controller => 'issues', :action => 'show', :id => '64',
148 :format => 'xml' }
148 :format => 'xml' }
149 )
149 )
150 assert_routing(
150 assert_routing(
151 { :method => 'get', :path => "/projects/23/issues/new" },
151 { :method => 'get', :path => "/projects/23/issues/new" },
152 { :controller => 'issues', :action => 'new', :project_id => '23' }
152 { :controller => 'issues', :action => 'new', :project_id => '23' }
153 )
153 )
154 end
154 end
155
155
156 def test_issues_form_update
156 def test_issues_form_update
157 assert_routing(
157 assert_routing(
158 { :method => 'post', :path => "/projects/23/issues/new" },
158 { :method => 'post', :path => "/projects/23/issues/new" },
159 { :controller => 'issues', :action => 'new', :project_id => '23' }
159 { :controller => 'issues', :action => 'new', :project_id => '23' }
160 )
160 )
161 assert_routing(
161 assert_routing(
162 { :method => 'post', :path => "/projects/23/issues" },
162 { :method => 'post', :path => "/projects/23/issues" },
163 { :controller => 'issues', :action => 'create', :project_id => '23' }
163 { :controller => 'issues', :action => 'create', :project_id => '23' }
164 )
164 )
165 assert_routing(
165 assert_routing(
166 { :method => 'post', :path => "/issues.xml" },
166 { :method => 'post', :path => "/issues.xml" },
167 { :controller => 'issues', :action => 'create', :format => 'xml' }
167 { :controller => 'issues', :action => 'create', :format => 'xml' }
168 )
168 )
169 assert_routing(
169 assert_routing(
170 { :method => 'get', :path => "/issues/64/edit" },
170 { :method => 'get', :path => "/issues/64/edit" },
171 { :controller => 'issues', :action => 'edit', :id => '64' }
171 { :controller => 'issues', :action => 'edit', :id => '64' }
172 )
172 )
173 assert_routing(
173 assert_routing(
174 { :method => 'put', :path => "/issues/1.xml" },
174 { :method => 'put', :path => "/issues/1.xml" },
175 { :controller => 'issues', :action => 'update', :id => '1',
175 { :controller => 'issues', :action => 'update', :id => '1',
176 :format => 'xml' }
176 :format => 'xml' }
177 )
177 )
178 assert_routing(
178 assert_routing(
179 { :method => 'delete', :path => "/issues/1.xml" },
179 { :method => 'delete', :path => "/issues/1.xml" },
180 { :controller => 'issues', :action => 'destroy', :id => '1',
180 { :controller => 'issues', :action => 'destroy', :id => '1',
181 :format => 'xml' }
181 :format => 'xml' }
182 )
182 )
183 end
183 end
184
184
185 def test_issues_extra_actions
185 def test_issues_extra_actions
186 assert_routing(
186 assert_routing(
187 { :method => 'get', :path => "/projects/23/issues/64/copy" },
187 { :method => 'get', :path => "/projects/23/issues/64/copy" },
188 { :controller => 'issues', :action => 'new', :project_id => '23',
188 { :controller => 'issues', :action => 'new', :project_id => '23',
189 :copy_from => '64' }
189 :copy_from => '64' }
190 )
190 )
191 assert_routing(
191 assert_routing(
192 { :method => 'get', :path => "/issues/move/new" },
192 { :method => 'get', :path => "/issues/move/new" },
193 { :controller => 'issue_moves', :action => 'new' }
193 { :controller => 'issue_moves', :action => 'new' }
194 )
194 )
195 assert_routing(
195 assert_routing(
196 { :method => 'post', :path => "/issues/move" },
196 { :method => 'post', :path => "/issues/move" },
197 { :controller => 'issue_moves', :action => 'create' }
197 { :controller => 'issue_moves', :action => 'create' }
198 )
198 )
199 assert_routing(
199 assert_routing(
200 { :method => 'post', :path => "/issues/1/quoted" },
200 { :method => 'post', :path => "/issues/1/quoted" },
201 { :controller => 'journals', :action => 'new', :id => '1' }
201 { :controller => 'journals', :action => 'new', :id => '1' }
202 )
202 )
203 assert_routing(
203 assert_routing(
204 { :method => 'get', :path => "/issues/calendar" },
204 { :method => 'get', :path => "/issues/calendar" },
205 { :controller => 'calendars', :action => 'show' }
205 { :controller => 'calendars', :action => 'show' }
206 )
206 )
207 assert_routing(
207 assert_routing(
208 { :method => 'get', :path => "/projects/project-name/issues/calendar" },
208 { :method => 'get', :path => "/projects/project-name/issues/calendar" },
209 { :controller => 'calendars', :action => 'show',
209 { :controller => 'calendars', :action => 'show',
210 :project_id => 'project-name' }
210 :project_id => 'project-name' }
211 )
211 )
212 assert_routing(
212 assert_routing(
213 { :method => 'get', :path => "/issues/gantt" },
213 { :method => 'get', :path => "/issues/gantt" },
214 { :controller => 'gantts', :action => 'show' }
214 { :controller => 'gantts', :action => 'show' }
215 )
215 )
216 assert_routing(
216 assert_routing(
217 { :method => 'get', :path => "/issues/gantt.pdf" },
217 { :method => 'get', :path => "/issues/gantt.pdf" },
218 { :controller => 'gantts', :action => 'show', :format => 'pdf' }
218 { :controller => 'gantts', :action => 'show', :format => 'pdf' }
219 )
219 )
220 assert_routing(
220 assert_routing(
221 { :method => 'get', :path => "/projects/project-name/issues/gantt" },
221 { :method => 'get', :path => "/projects/project-name/issues/gantt" },
222 { :controller => 'gantts', :action => 'show',
222 { :controller => 'gantts', :action => 'show',
223 :project_id => 'project-name' }
223 :project_id => 'project-name' }
224 )
224 )
225 assert_routing(
225 assert_routing(
226 { :method => 'get', :path => "/projects/project-name/issues/gantt.pdf" },
226 { :method => 'get', :path => "/projects/project-name/issues/gantt.pdf" },
227 { :controller => 'gantts', :action => 'show',
227 { :controller => 'gantts', :action => 'show',
228 :project_id => 'project-name', :format => 'pdf' }
228 :project_id => 'project-name', :format => 'pdf' }
229 )
229 )
230 assert_routing(
230 assert_routing(
231 { :method => 'get', :path => "/issues/auto_complete" },
231 { :method => 'get', :path => "/issues/auto_complete" },
232 { :controller => 'auto_completes', :action => 'issues' }
232 { :controller => 'auto_completes', :action => 'issues' }
233 )
233 )
234 assert_routing(
234 assert_routing(
235 { :method => 'get', :path => "/issues/preview/123" },
235 { :method => 'get', :path => "/issues/preview/123" },
236 { :controller => 'previews', :action => 'issue', :id => '123' }
236 { :controller => 'previews', :action => 'issue', :id => '123' }
237 )
237 )
238 assert_routing(
238 assert_routing(
239 { :method => 'post', :path => "/issues/preview/123" },
239 { :method => 'post', :path => "/issues/preview/123" },
240 { :controller => 'previews', :action => 'issue', :id => '123' }
240 { :controller => 'previews', :action => 'issue', :id => '123' }
241 )
241 )
242 assert_routing(
242 assert_routing(
243 { :method => 'get', :path => "/issues/context_menu" },
243 { :method => 'get', :path => "/issues/context_menu" },
244 { :controller => 'context_menus', :action => 'issues' }
244 { :controller => 'context_menus', :action => 'issues' }
245 )
245 )
246 assert_routing(
246 assert_routing(
247 { :method => 'post', :path => "/issues/context_menu" },
247 { :method => 'post', :path => "/issues/context_menu" },
248 { :controller => 'context_menus', :action => 'issues' }
248 { :controller => 'context_menus', :action => 'issues' }
249 )
249 )
250 assert_routing(
250 assert_routing(
251 { :method => 'get', :path => "/issues/changes" },
251 { :method => 'get', :path => "/issues/changes" },
252 { :controller => 'journals', :action => 'index' }
252 { :controller => 'journals', :action => 'index' }
253 )
253 )
254 assert_routing(
254 assert_routing(
255 { :method => 'get', :path => "/issues/bulk_edit" },
255 { :method => 'get', :path => "/issues/bulk_edit" },
256 { :controller => 'issues', :action => 'bulk_edit' }
256 { :controller => 'issues', :action => 'bulk_edit' }
257 )
257 )
258 assert_routing(
258 assert_routing(
259 { :method => 'post', :path => "/issues/bulk_update" },
259 { :method => 'post', :path => "/issues/bulk_update" },
260 { :controller => 'issues', :action => 'bulk_update' }
260 { :controller => 'issues', :action => 'bulk_update' }
261 )
261 )
262 end
262 end
263
263
264 def test_issue_categories
264 def test_issue_categories
265 assert_routing(
265 assert_routing(
266 { :method => 'get', :path => "/projects/foo/issue_categories" },
266 { :method => 'get', :path => "/projects/foo/issue_categories" },
267 { :controller => 'issue_categories', :action => 'index',
267 { :controller => 'issue_categories', :action => 'index',
268 :project_id => 'foo' }
268 :project_id => 'foo' }
269 )
269 )
270 assert_routing(
270 assert_routing(
271 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
271 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
272 { :controller => 'issue_categories', :action => 'index',
272 { :controller => 'issue_categories', :action => 'index',
273 :project_id => 'foo', :format => 'xml' }
273 :project_id => 'foo', :format => 'xml' }
274 )
274 )
275 assert_routing(
275 assert_routing(
276 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
276 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
277 { :controller => 'issue_categories', :action => 'index',
277 { :controller => 'issue_categories', :action => 'index',
278 :project_id => 'foo', :format => 'json' }
278 :project_id => 'foo', :format => 'json' }
279 )
279 )
280 assert_routing(
280 assert_routing(
281 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
281 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
282 { :controller => 'issue_categories', :action => 'new',
282 { :controller => 'issue_categories', :action => 'new',
283 :project_id => 'foo' }
283 :project_id => 'foo' }
284 )
284 )
285 assert_routing(
285 assert_routing(
286 { :method => 'post', :path => "/projects/foo/issue_categories" },
286 { :method => 'post', :path => "/projects/foo/issue_categories" },
287 { :controller => 'issue_categories', :action => 'create',
287 { :controller => 'issue_categories', :action => 'create',
288 :project_id => 'foo' }
288 :project_id => 'foo' }
289 )
289 )
290 assert_routing(
290 assert_routing(
291 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
291 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
292 { :controller => 'issue_categories', :action => 'create',
292 { :controller => 'issue_categories', :action => 'create',
293 :project_id => 'foo', :format => 'xml' }
293 :project_id => 'foo', :format => 'xml' }
294 )
294 )
295 assert_routing(
295 assert_routing(
296 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
296 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
297 { :controller => 'issue_categories', :action => 'create',
297 { :controller => 'issue_categories', :action => 'create',
298 :project_id => 'foo', :format => 'json' }
298 :project_id => 'foo', :format => 'json' }
299 )
299 )
300 assert_routing(
300 assert_routing(
301 { :method => 'get', :path => "/issue_categories/1" },
301 { :method => 'get', :path => "/issue_categories/1" },
302 { :controller => 'issue_categories', :action => 'show', :id => '1' }
302 { :controller => 'issue_categories', :action => 'show', :id => '1' }
303 )
303 )
304 assert_routing(
304 assert_routing(
305 { :method => 'get', :path => "/issue_categories/1.xml" },
305 { :method => 'get', :path => "/issue_categories/1.xml" },
306 { :controller => 'issue_categories', :action => 'show', :id => '1',
306 { :controller => 'issue_categories', :action => 'show', :id => '1',
307 :format => 'xml' }
307 :format => 'xml' }
308 )
308 )
309 assert_routing(
309 assert_routing(
310 { :method => 'get', :path => "/issue_categories/1.json" },
310 { :method => 'get', :path => "/issue_categories/1.json" },
311 { :controller => 'issue_categories', :action => 'show', :id => '1',
311 { :controller => 'issue_categories', :action => 'show', :id => '1',
312 :format => 'json' }
312 :format => 'json' }
313 )
313 )
314 assert_routing(
314 assert_routing(
315 { :method => 'get', :path => "/issue_categories/1/edit" },
315 { :method => 'get', :path => "/issue_categories/1/edit" },
316 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
316 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
317 )
317 )
318 assert_routing(
318 assert_routing(
319 { :method => 'put', :path => "/issue_categories/1" },
319 { :method => 'put', :path => "/issue_categories/1" },
320 { :controller => 'issue_categories', :action => 'update', :id => '1' }
320 { :controller => 'issue_categories', :action => 'update', :id => '1' }
321 )
321 )
322 assert_routing(
322 assert_routing(
323 { :method => 'put', :path => "/issue_categories/1.xml" },
323 { :method => 'put', :path => "/issue_categories/1.xml" },
324 { :controller => 'issue_categories', :action => 'update', :id => '1',
324 { :controller => 'issue_categories', :action => 'update', :id => '1',
325 :format => 'xml' }
325 :format => 'xml' }
326 )
326 )
327 assert_routing(
327 assert_routing(
328 { :method => 'put', :path => "/issue_categories/1.json" },
328 { :method => 'put', :path => "/issue_categories/1.json" },
329 { :controller => 'issue_categories', :action => 'update', :id => '1',
329 { :controller => 'issue_categories', :action => 'update', :id => '1',
330 :format => 'json' }
330 :format => 'json' }
331 )
331 )
332 assert_routing(
332 assert_routing(
333 { :method => 'delete', :path => "/issue_categories/1" },
333 { :method => 'delete', :path => "/issue_categories/1" },
334 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
334 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
335 )
335 )
336 assert_routing(
336 assert_routing(
337 { :method => 'delete', :path => "/issue_categories/1.xml" },
337 { :method => 'delete', :path => "/issue_categories/1.xml" },
338 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
338 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
339 :format => 'xml' }
339 :format => 'xml' }
340 )
340 )
341 assert_routing(
341 assert_routing(
342 { :method => 'delete', :path => "/issue_categories/1.json" },
342 { :method => 'delete', :path => "/issue_categories/1.json" },
343 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
343 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
344 :format => 'json' }
344 :format => 'json' }
345 )
345 )
346 end
346 end
347
347
348 def test_issue_relations
348 def test_issue_relations
349 assert_routing(
349 assert_routing(
350 { :method => 'get', :path => "/issues/1/relations" },
350 { :method => 'get', :path => "/issues/1/relations" },
351 { :controller => 'issue_relations', :action => 'index',
351 { :controller => 'issue_relations', :action => 'index',
352 :issue_id => '1' }
352 :issue_id => '1' }
353 )
353 )
354 assert_routing(
354 assert_routing(
355 { :method => 'get', :path => "/issues/1/relations.xml" },
355 { :method => 'get', :path => "/issues/1/relations.xml" },
356 { :controller => 'issue_relations', :action => 'index',
356 { :controller => 'issue_relations', :action => 'index',
357 :issue_id => '1', :format => 'xml' }
357 :issue_id => '1', :format => 'xml' }
358 )
358 )
359 assert_routing(
359 assert_routing(
360 { :method => 'get', :path => "/issues/1/relations.json" },
360 { :method => 'get', :path => "/issues/1/relations.json" },
361 { :controller => 'issue_relations', :action => 'index',
361 { :controller => 'issue_relations', :action => 'index',
362 :issue_id => '1', :format => 'json' }
362 :issue_id => '1', :format => 'json' }
363 )
363 )
364 assert_routing(
364 assert_routing(
365 { :method => 'post', :path => "/issues/1/relations" },
365 { :method => 'post', :path => "/issues/1/relations" },
366 { :controller => 'issue_relations', :action => 'create',
366 { :controller => 'issue_relations', :action => 'create',
367 :issue_id => '1' }
367 :issue_id => '1' }
368 )
368 )
369 assert_routing(
369 assert_routing(
370 { :method => 'post', :path => "/issues/1/relations.xml" },
370 { :method => 'post', :path => "/issues/1/relations.xml" },
371 { :controller => 'issue_relations', :action => 'create',
371 { :controller => 'issue_relations', :action => 'create',
372 :issue_id => '1', :format => 'xml' }
372 :issue_id => '1', :format => 'xml' }
373 )
373 )
374 assert_routing(
374 assert_routing(
375 { :method => 'post', :path => "/issues/1/relations.json" },
375 { :method => 'post', :path => "/issues/1/relations.json" },
376 { :controller => 'issue_relations', :action => 'create',
376 { :controller => 'issue_relations', :action => 'create',
377 :issue_id => '1', :format => 'json' }
377 :issue_id => '1', :format => 'json' }
378 )
378 )
379 assert_routing(
379 assert_routing(
380 { :method => 'get', :path => "/relations/23" },
380 { :method => 'get', :path => "/relations/23" },
381 { :controller => 'issue_relations', :action => 'show', :id => '23' }
381 { :controller => 'issue_relations', :action => 'show', :id => '23' }
382 )
382 )
383 assert_routing(
383 assert_routing(
384 { :method => 'get', :path => "/relations/23.xml" },
384 { :method => 'get', :path => "/relations/23.xml" },
385 { :controller => 'issue_relations', :action => 'show', :id => '23',
385 { :controller => 'issue_relations', :action => 'show', :id => '23',
386 :format => 'xml' }
386 :format => 'xml' }
387 )
387 )
388 assert_routing(
388 assert_routing(
389 { :method => 'get', :path => "/relations/23.json" },
389 { :method => 'get', :path => "/relations/23.json" },
390 { :controller => 'issue_relations', :action => 'show', :id => '23',
390 { :controller => 'issue_relations', :action => 'show', :id => '23',
391 :format => 'json' }
391 :format => 'json' }
392 )
392 )
393 assert_routing(
393 assert_routing(
394 { :method => 'delete', :path => "/relations/23" },
394 { :method => 'delete', :path => "/relations/23" },
395 { :controller => 'issue_relations', :action => 'destroy', :id => '23' }
395 { :controller => 'issue_relations', :action => 'destroy', :id => '23' }
396 )
396 )
397 assert_routing(
397 assert_routing(
398 { :method => 'delete', :path => "/relations/23.xml" },
398 { :method => 'delete', :path => "/relations/23.xml" },
399 { :controller => 'issue_relations', :action => 'destroy', :id => '23',
399 { :controller => 'issue_relations', :action => 'destroy', :id => '23',
400 :format => 'xml' }
400 :format => 'xml' }
401 )
401 )
402 assert_routing(
402 assert_routing(
403 { :method => 'delete', :path => "/relations/23.json" },
403 { :method => 'delete', :path => "/relations/23.json" },
404 { :controller => 'issue_relations', :action => 'destroy', :id => '23',
404 { :controller => 'issue_relations', :action => 'destroy', :id => '23',
405 :format => 'json' }
405 :format => 'json' }
406 )
406 )
407 end
407 end
408
408
409 def test_issue_reports
409 def test_issue_reports
410 assert_routing(
410 assert_routing(
411 { :method => 'get', :path => "/projects/567/issues/report" },
411 { :method => 'get', :path => "/projects/567/issues/report" },
412 { :controller => 'reports', :action => 'issue_report', :id => '567' }
412 { :controller => 'reports', :action => 'issue_report', :id => '567' }
413 )
413 )
414 assert_routing(
414 assert_routing(
415 { :method => 'get', :path => "/projects/567/issues/report/assigned_to" },
415 { :method => 'get', :path => "/projects/567/issues/report/assigned_to" },
416 { :controller => 'reports', :action => 'issue_report_details',
416 { :controller => 'reports', :action => 'issue_report_details',
417 :id => '567', :detail => 'assigned_to' }
417 :id => '567', :detail => 'assigned_to' }
418 )
418 )
419 end
419 end
420
420
421 def test_members
421 def test_members
422 assert_routing(
422 assert_routing(
423 { :method => 'post', :path => "/projects/5234/members/new" },
423 { :method => 'post', :path => "/projects/5234/members/new" },
424 { :controller => 'members', :action => 'new', :id => '5234' }
424 { :controller => 'members', :action => 'new', :id => '5234' }
425 )
425 )
426 end
426 end
427
427
428 def test_messages
429 assert_routing(
430 { :method => 'get', :path => "/boards/22/topics/2" },
431 { :controller => 'messages', :action => 'show', :id => '2',
432 :board_id => '22' }
433 )
434 assert_routing(
435 { :method => 'get', :path => "/boards/lala/topics/new" },
436 { :controller => 'messages', :action => 'new', :board_id => 'lala' }
437 )
438 assert_routing(
439 { :method => 'get', :path => "/boards/lala/topics/22/edit" },
440 { :controller => 'messages', :action => 'edit', :id => '22',
441 :board_id => 'lala' }
442 )
443 assert_routing(
444 { :method => 'post', :path => "/boards/lala/topics/new" },
445 { :controller => 'messages', :action => 'new', :board_id => 'lala' }
446 )
447 assert_routing(
448 { :method => 'post', :path => "/boards/lala/topics/22/edit" },
449 { :controller => 'messages', :action => 'edit', :id => '22',
450 :board_id => 'lala' }
451 )
452 assert_routing(
453 { :method => 'post', :path => "/boards/22/topics/555/replies" },
454 { :controller => 'messages', :action => 'reply', :id => '555',
455 :board_id => '22' }
456 )
457 assert_routing(
458 { :method => 'post', :path => "/boards/22/topics/555/destroy" },
459 { :controller => 'messages', :action => 'destroy', :id => '555',
460 :board_id => '22' }
461 )
462 end
463
464 def test_news
428 def test_news
465 assert_routing(
429 assert_routing(
466 { :method => 'get', :path => "/news" },
430 { :method => 'get', :path => "/news" },
467 { :controller => 'news', :action => 'index' }
431 { :controller => 'news', :action => 'index' }
468 )
432 )
469 assert_routing(
433 assert_routing(
470 { :method => 'get', :path => "/news.atom" },
434 { :method => 'get', :path => "/news.atom" },
471 { :controller => 'news', :action => 'index', :format => 'atom' }
435 { :controller => 'news', :action => 'index', :format => 'atom' }
472 )
436 )
473 assert_routing(
437 assert_routing(
474 { :method => 'get', :path => "/news.xml" },
438 { :method => 'get', :path => "/news.xml" },
475 { :controller => 'news', :action => 'index', :format => 'xml' }
439 { :controller => 'news', :action => 'index', :format => 'xml' }
476 )
440 )
477 assert_routing(
441 assert_routing(
478 { :method => 'get', :path => "/news.json" },
442 { :method => 'get', :path => "/news.json" },
479 { :controller => 'news', :action => 'index', :format => 'json' }
443 { :controller => 'news', :action => 'index', :format => 'json' }
480 )
444 )
481 assert_routing(
445 assert_routing(
482 { :method => 'get', :path => "/projects/567/news" },
446 { :method => 'get', :path => "/projects/567/news" },
483 { :controller => 'news', :action => 'index', :project_id => '567' }
447 { :controller => 'news', :action => 'index', :project_id => '567' }
484 )
448 )
485 assert_routing(
449 assert_routing(
486 { :method => 'get', :path => "/projects/567/news.atom" },
450 { :method => 'get', :path => "/projects/567/news.atom" },
487 { :controller => 'news', :action => 'index', :format => 'atom',
451 { :controller => 'news', :action => 'index', :format => 'atom',
488 :project_id => '567' }
452 :project_id => '567' }
489 )
453 )
490 assert_routing(
454 assert_routing(
491 { :method => 'get', :path => "/projects/567/news.xml" },
455 { :method => 'get', :path => "/projects/567/news.xml" },
492 { :controller => 'news', :action => 'index', :format => 'xml',
456 { :controller => 'news', :action => 'index', :format => 'xml',
493 :project_id => '567' }
457 :project_id => '567' }
494 )
458 )
495 assert_routing(
459 assert_routing(
496 { :method => 'get', :path => "/projects/567/news.json" },
460 { :method => 'get', :path => "/projects/567/news.json" },
497 { :controller => 'news', :action => 'index', :format => 'json',
461 { :controller => 'news', :action => 'index', :format => 'json',
498 :project_id => '567' }
462 :project_id => '567' }
499 )
463 )
500 assert_routing(
464 assert_routing(
501 { :method => 'get', :path => "/news/2" },
465 { :method => 'get', :path => "/news/2" },
502 { :controller => 'news', :action => 'show', :id => '2' }
466 { :controller => 'news', :action => 'show', :id => '2' }
503 )
467 )
504 assert_routing(
468 assert_routing(
505 { :method => 'get', :path => "/projects/567/news/new" },
469 { :method => 'get', :path => "/projects/567/news/new" },
506 { :controller => 'news', :action => 'new', :project_id => '567' }
470 { :controller => 'news', :action => 'new', :project_id => '567' }
507 )
471 )
508 assert_routing(
472 assert_routing(
509 { :method => 'get', :path => "/news/234" },
473 { :method => 'get', :path => "/news/234" },
510 { :controller => 'news', :action => 'show', :id => '234' }
474 { :controller => 'news', :action => 'show', :id => '234' }
511 )
475 )
512 assert_routing(
476 assert_routing(
513 { :method => 'get', :path => "/news/567/edit" },
477 { :method => 'get', :path => "/news/567/edit" },
514 { :controller => 'news', :action => 'edit', :id => '567' }
478 { :controller => 'news', :action => 'edit', :id => '567' }
515 )
479 )
516 assert_routing(
480 assert_routing(
517 { :method => 'get', :path => "/news/preview" },
481 { :method => 'get', :path => "/news/preview" },
518 { :controller => 'previews', :action => 'news' }
482 { :controller => 'previews', :action => 'news' }
519 )
483 )
520 assert_routing(
484 assert_routing(
521 { :method => 'post', :path => "/projects/567/news" },
485 { :method => 'post', :path => "/projects/567/news" },
522 { :controller => 'news', :action => 'create', :project_id => '567' }
486 { :controller => 'news', :action => 'create', :project_id => '567' }
523 )
487 )
524 assert_routing(
488 assert_routing(
525 { :method => 'post', :path => "/news/567/comments" },
489 { :method => 'post', :path => "/news/567/comments" },
526 { :controller => 'comments', :action => 'create', :id => '567' }
490 { :controller => 'comments', :action => 'create', :id => '567' }
527 )
491 )
528 assert_routing(
492 assert_routing(
529 { :method => 'put', :path => "/news/567" },
493 { :method => 'put', :path => "/news/567" },
530 { :controller => 'news', :action => 'update', :id => '567' }
494 { :controller => 'news', :action => 'update', :id => '567' }
531 )
495 )
532 assert_routing(
496 assert_routing(
533 { :method => 'delete', :path => "/news/567" },
497 { :method => 'delete', :path => "/news/567" },
534 { :controller => 'news', :action => 'destroy', :id => '567' }
498 { :controller => 'news', :action => 'destroy', :id => '567' }
535 )
499 )
536 assert_routing(
500 assert_routing(
537 { :method => 'delete', :path => "/news/567/comments/15" },
501 { :method => 'delete', :path => "/news/567/comments/15" },
538 { :controller => 'comments', :action => 'destroy', :id => '567',
502 { :controller => 'comments', :action => 'destroy', :id => '567',
539 :comment_id => '15' }
503 :comment_id => '15' }
540 )
504 )
541 end
505 end
542
506
543 def test_projects
507 def test_projects
544 assert_routing(
508 assert_routing(
545 { :method => 'get', :path => "/projects" },
509 { :method => 'get', :path => "/projects" },
546 { :controller => 'projects', :action => 'index' }
510 { :controller => 'projects', :action => 'index' }
547 )
511 )
548 assert_routing(
512 assert_routing(
549 { :method => 'get', :path => "/projects.atom" },
513 { :method => 'get', :path => "/projects.atom" },
550 { :controller => 'projects', :action => 'index', :format => 'atom' }
514 { :controller => 'projects', :action => 'index', :format => 'atom' }
551 )
515 )
552 assert_routing(
516 assert_routing(
553 { :method => 'get', :path => "/projects.xml" },
517 { :method => 'get', :path => "/projects.xml" },
554 { :controller => 'projects', :action => 'index', :format => 'xml' }
518 { :controller => 'projects', :action => 'index', :format => 'xml' }
555 )
519 )
556 assert_routing(
520 assert_routing(
557 { :method => 'get', :path => "/projects/new" },
521 { :method => 'get', :path => "/projects/new" },
558 { :controller => 'projects', :action => 'new' }
522 { :controller => 'projects', :action => 'new' }
559 )
523 )
560 assert_routing(
524 assert_routing(
561 { :method => 'get', :path => "/projects/test" },
525 { :method => 'get', :path => "/projects/test" },
562 { :controller => 'projects', :action => 'show', :id => 'test' }
526 { :controller => 'projects', :action => 'show', :id => 'test' }
563 )
527 )
564 assert_routing(
528 assert_routing(
565 { :method => 'get', :path => "/projects/1.xml" },
529 { :method => 'get', :path => "/projects/1.xml" },
566 { :controller => 'projects', :action => 'show', :id => '1',
530 { :controller => 'projects', :action => 'show', :id => '1',
567 :format => 'xml' }
531 :format => 'xml' }
568 )
532 )
569 assert_routing(
533 assert_routing(
570 { :method => 'get', :path => "/projects/4223/settings" },
534 { :method => 'get', :path => "/projects/4223/settings" },
571 { :controller => 'projects', :action => 'settings', :id => '4223' }
535 { :controller => 'projects', :action => 'settings', :id => '4223' }
572 )
536 )
573 assert_routing(
537 assert_routing(
574 { :method => 'get', :path => "/projects/4223/settings/members" },
538 { :method => 'get', :path => "/projects/4223/settings/members" },
575 { :controller => 'projects', :action => 'settings', :id => '4223',
539 { :controller => 'projects', :action => 'settings', :id => '4223',
576 :tab => 'members' }
540 :tab => 'members' }
577 )
541 )
578 assert_routing(
542 assert_routing(
579 { :method => 'get', :path => "/projects/33/files" },
543 { :method => 'get', :path => "/projects/33/files" },
580 { :controller => 'files', :action => 'index', :project_id => '33' }
544 { :controller => 'files', :action => 'index', :project_id => '33' }
581 )
545 )
582 assert_routing(
546 assert_routing(
583 { :method => 'get', :path => "/projects/33/files/new" },
547 { :method => 'get', :path => "/projects/33/files/new" },
584 { :controller => 'files', :action => 'new', :project_id => '33' }
548 { :controller => 'files', :action => 'new', :project_id => '33' }
585 )
549 )
586 assert_routing(
550 assert_routing(
587 { :method => 'get', :path => "/projects/33/roadmap" },
551 { :method => 'get', :path => "/projects/33/roadmap" },
588 { :controller => 'versions', :action => 'index', :project_id => '33' }
552 { :controller => 'versions', :action => 'index', :project_id => '33' }
589 )
553 )
590 assert_routing(
554 assert_routing(
591 { :method => 'get', :path => "/projects/33/activity" },
555 { :method => 'get', :path => "/projects/33/activity" },
592 { :controller => 'activities', :action => 'index', :id => '33' }
556 { :controller => 'activities', :action => 'index', :id => '33' }
593 )
557 )
594 assert_routing(
558 assert_routing(
595 { :method => 'get', :path => "/projects/33/activity.atom" },
559 { :method => 'get', :path => "/projects/33/activity.atom" },
596 { :controller => 'activities', :action => 'index', :id => '33',
560 { :controller => 'activities', :action => 'index', :id => '33',
597 :format => 'atom' }
561 :format => 'atom' }
598 )
562 )
599 assert_routing(
563 assert_routing(
600 { :method => 'post', :path => "/projects" },
564 { :method => 'post', :path => "/projects" },
601 { :controller => 'projects', :action => 'create' }
565 { :controller => 'projects', :action => 'create' }
602 )
566 )
603 assert_routing(
567 assert_routing(
604 { :method => 'post', :path => "/projects.xml" },
568 { :method => 'post', :path => "/projects.xml" },
605 { :controller => 'projects', :action => 'create', :format => 'xml' }
569 { :controller => 'projects', :action => 'create', :format => 'xml' }
606 )
570 )
607 assert_routing(
571 assert_routing(
608 { :method => 'post', :path => "/projects/33/files" },
572 { :method => 'post', :path => "/projects/33/files" },
609 { :controller => 'files', :action => 'create', :project_id => '33' }
573 { :controller => 'files', :action => 'create', :project_id => '33' }
610 )
574 )
611 assert_routing(
575 assert_routing(
612 { :method => 'post', :path => "/projects/64/archive" },
576 { :method => 'post', :path => "/projects/64/archive" },
613 { :controller => 'projects', :action => 'archive', :id => '64' }
577 { :controller => 'projects', :action => 'archive', :id => '64' }
614 )
578 )
615 assert_routing(
579 assert_routing(
616 { :method => 'post', :path => "/projects/64/unarchive" },
580 { :method => 'post', :path => "/projects/64/unarchive" },
617 { :controller => 'projects', :action => 'unarchive', :id => '64' }
581 { :controller => 'projects', :action => 'unarchive', :id => '64' }
618 )
582 )
619 assert_routing(
583 assert_routing(
620 { :method => 'put', :path => "/projects/64/enumerations" },
584 { :method => 'put', :path => "/projects/64/enumerations" },
621 { :controller => 'project_enumerations', :action => 'update',
585 { :controller => 'project_enumerations', :action => 'update',
622 :project_id => '64' }
586 :project_id => '64' }
623 )
587 )
624 assert_routing(
588 assert_routing(
625 { :method => 'put', :path => "/projects/4223" },
589 { :method => 'put', :path => "/projects/4223" },
626 { :controller => 'projects', :action => 'update', :id => '4223' }
590 { :controller => 'projects', :action => 'update', :id => '4223' }
627 )
591 )
628 assert_routing(
592 assert_routing(
629 { :method => 'put', :path => "/projects/1.xml" },
593 { :method => 'put', :path => "/projects/1.xml" },
630 { :controller => 'projects', :action => 'update', :id => '1',
594 { :controller => 'projects', :action => 'update', :id => '1',
631 :format => 'xml' }
595 :format => 'xml' }
632 )
596 )
633 assert_routing(
597 assert_routing(
634 { :method => 'delete', :path => "/projects/64" },
598 { :method => 'delete', :path => "/projects/64" },
635 { :controller => 'projects', :action => 'destroy', :id => '64' }
599 { :controller => 'projects', :action => 'destroy', :id => '64' }
636 )
600 )
637 assert_routing(
601 assert_routing(
638 { :method => 'delete', :path => "/projects/1.xml" },
602 { :method => 'delete', :path => "/projects/1.xml" },
639 { :controller => 'projects', :action => 'destroy', :id => '1',
603 { :controller => 'projects', :action => 'destroy', :id => '1',
640 :format => 'xml' }
604 :format => 'xml' }
641 )
605 )
642 assert_routing(
606 assert_routing(
643 { :method => 'delete', :path => "/projects/64/enumerations" },
607 { :method => 'delete', :path => "/projects/64/enumerations" },
644 { :controller => 'project_enumerations', :action => 'destroy',
608 { :controller => 'project_enumerations', :action => 'destroy',
645 :project_id => '64' }
609 :project_id => '64' }
646 )
610 )
647 end
611 end
648
612
649 def test_queries
613 def test_queries
650 assert_routing(
614 assert_routing(
651 { :method => 'get', :path => "/queries.xml" },
615 { :method => 'get', :path => "/queries.xml" },
652 { :controller => 'queries', :action => 'index', :format => 'xml' }
616 { :controller => 'queries', :action => 'index', :format => 'xml' }
653 )
617 )
654 assert_routing(
618 assert_routing(
655 { :method => 'get', :path => "/queries.json" },
619 { :method => 'get', :path => "/queries.json" },
656 { :controller => 'queries', :action => 'index', :format => 'json' }
620 { :controller => 'queries', :action => 'index', :format => 'json' }
657 )
621 )
658 assert_routing(
622 assert_routing(
659 { :method => 'get', :path => "/queries/new" },
623 { :method => 'get', :path => "/queries/new" },
660 { :controller => 'queries', :action => 'new' }
624 { :controller => 'queries', :action => 'new' }
661 )
625 )
662 assert_routing(
626 assert_routing(
663 { :method => 'get', :path => "/projects/redmine/queries/new" },
627 { :method => 'get', :path => "/projects/redmine/queries/new" },
664 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
628 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
665 )
629 )
666 assert_routing(
630 assert_routing(
667 { :method => 'post', :path => "/queries" },
631 { :method => 'post', :path => "/queries" },
668 { :controller => 'queries', :action => 'create' }
632 { :controller => 'queries', :action => 'create' }
669 )
633 )
670 assert_routing(
634 assert_routing(
671 { :method => 'post', :path => "/projects/redmine/queries" },
635 { :method => 'post', :path => "/projects/redmine/queries" },
672 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
636 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
673 )
637 )
674 assert_routing(
638 assert_routing(
675 { :method => 'get', :path => "/queries/1/edit" },
639 { :method => 'get', :path => "/queries/1/edit" },
676 { :controller => 'queries', :action => 'edit', :id => '1' }
640 { :controller => 'queries', :action => 'edit', :id => '1' }
677 )
641 )
678 assert_routing(
642 assert_routing(
679 { :method => 'put', :path => "/queries/1" },
643 { :method => 'put', :path => "/queries/1" },
680 { :controller => 'queries', :action => 'update', :id => '1' }
644 { :controller => 'queries', :action => 'update', :id => '1' }
681 )
645 )
682 assert_routing(
646 assert_routing(
683 { :method => 'delete', :path => "/queries/1" },
647 { :method => 'delete', :path => "/queries/1" },
684 { :controller => 'queries', :action => 'destroy', :id => '1' }
648 { :controller => 'queries', :action => 'destroy', :id => '1' }
685 )
649 )
686 end
650 end
687
651
688 def test_repositories
652 def test_repositories
689 assert_routing(
653 assert_routing(
690 { :method => 'get',
654 { :method => 'get',
691 :path => "/projects/redmine/repository" },
655 :path => "/projects/redmine/repository" },
692 { :controller => 'repositories', :action => 'show', :id => 'redmine' }
656 { :controller => 'repositories', :action => 'show', :id => 'redmine' }
693 )
657 )
694 assert_routing(
658 assert_routing(
695 { :method => 'get',
659 { :method => 'get',
696 :path => "/projects/redmine/repository/edit" },
660 :path => "/projects/redmine/repository/edit" },
697 { :controller => 'repositories', :action => 'edit', :id => 'redmine' }
661 { :controller => 'repositories', :action => 'edit', :id => 'redmine' }
698 )
662 )
699 assert_routing(
663 assert_routing(
700 { :method => 'get',
664 { :method => 'get',
701 :path => "/projects/redmine/repository/revisions" },
665 :path => "/projects/redmine/repository/revisions" },
702 { :controller => 'repositories', :action => 'revisions', :id => 'redmine' }
666 { :controller => 'repositories', :action => 'revisions', :id => 'redmine' }
703 )
667 )
704 assert_routing(
668 assert_routing(
705 { :method => 'get',
669 { :method => 'get',
706 :path => "/projects/redmine/repository/revisions.atom" },
670 :path => "/projects/redmine/repository/revisions.atom" },
707 { :controller => 'repositories', :action => 'revisions', :id => 'redmine',
671 { :controller => 'repositories', :action => 'revisions', :id => 'redmine',
708 :format => 'atom' }
672 :format => 'atom' }
709 )
673 )
710 assert_routing(
674 assert_routing(
711 { :method => 'get',
675 { :method => 'get',
712 :path => "/projects/redmine/repository/revisions/2457" },
676 :path => "/projects/redmine/repository/revisions/2457" },
713 { :controller => 'repositories', :action => 'revision', :id => 'redmine',
677 { :controller => 'repositories', :action => 'revision', :id => 'redmine',
714 :rev => '2457' }
678 :rev => '2457' }
715 )
679 )
716 assert_routing(
680 assert_routing(
717 { :method => 'get',
681 { :method => 'get',
718 :path => "/projects/redmine/repository/revisions/2457/diff" },
682 :path => "/projects/redmine/repository/revisions/2457/diff" },
719 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
683 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
720 :rev => '2457' }
684 :rev => '2457' }
721 )
685 )
722 assert_routing(
686 assert_routing(
723 { :method => 'get',
687 { :method => 'get',
724 :path => "/projects/redmine/repository/revisions/2457/diff.diff" },
688 :path => "/projects/redmine/repository/revisions/2457/diff.diff" },
725 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
689 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
726 :rev => '2457', :format => 'diff' }
690 :rev => '2457', :format => 'diff' }
727 )
691 )
728 assert_routing(
692 assert_routing(
729 { :method => 'get',
693 { :method => 'get',
730 :path => "/projects/redmine/repository/diff/path/to/file.c" },
694 :path => "/projects/redmine/repository/diff/path/to/file.c" },
731 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
695 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
732 :path => %w[path to file.c] }
696 :path => %w[path to file.c] }
733 )
697 )
734 assert_routing(
698 assert_routing(
735 { :method => 'get',
699 { :method => 'get',
736 :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" },
700 :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" },
737 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
701 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
738 :path => %w[path to file.c], :rev => '2' }
702 :path => %w[path to file.c], :rev => '2' }
739 )
703 )
740 assert_routing(
704 assert_routing(
741 { :method => 'get',
705 { :method => 'get',
742 :path => "/projects/redmine/repository/browse/path/to/file.c" },
706 :path => "/projects/redmine/repository/browse/path/to/file.c" },
743 { :controller => 'repositories', :action => 'browse', :id => 'redmine',
707 { :controller => 'repositories', :action => 'browse', :id => 'redmine',
744 :path => %w[path to file.c] }
708 :path => %w[path to file.c] }
745 )
709 )
746 assert_routing(
710 assert_routing(
747 { :method => 'get',
711 { :method => 'get',
748 :path => "/projects/redmine/repository/entry/path/to/file.c" },
712 :path => "/projects/redmine/repository/entry/path/to/file.c" },
749 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
713 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
750 :path => %w[path to file.c] }
714 :path => %w[path to file.c] }
751 )
715 )
752 assert_routing(
716 assert_routing(
753 { :method => 'get',
717 { :method => 'get',
754 :path => "/projects/redmine/repository/revisions/2/entry/path/to/file.c" },
718 :path => "/projects/redmine/repository/revisions/2/entry/path/to/file.c" },
755 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
719 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
756 :path => %w[path to file.c], :rev => '2' }
720 :path => %w[path to file.c], :rev => '2' }
757 )
721 )
758 assert_routing(
722 assert_routing(
759 { :method => 'get',
723 { :method => 'get',
760 :path => "/projects/redmine/repository/raw/path/to/file.c" },
724 :path => "/projects/redmine/repository/raw/path/to/file.c" },
761 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
725 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
762 :path => %w[path to file.c], :format => 'raw' }
726 :path => %w[path to file.c], :format => 'raw' }
763 )
727 )
764 assert_routing(
728 assert_routing(
765 { :method => 'get',
729 { :method => 'get',
766 :path => "/projects/redmine/repository/revisions/2/raw/path/to/file.c" },
730 :path => "/projects/redmine/repository/revisions/2/raw/path/to/file.c" },
767 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
731 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
768 :path => %w[path to file.c], :rev => '2', :format => 'raw' }
732 :path => %w[path to file.c], :rev => '2', :format => 'raw' }
769 )
733 )
770 assert_routing(
734 assert_routing(
771 { :method => 'get',
735 { :method => 'get',
772 :path => "/projects/redmine/repository/annotate/path/to/file.c" },
736 :path => "/projects/redmine/repository/annotate/path/to/file.c" },
773 { :controller => 'repositories', :action => 'annotate', :id => 'redmine',
737 { :controller => 'repositories', :action => 'annotate', :id => 'redmine',
774 :path => %w[path to file.c] }
738 :path => %w[path to file.c] }
775 )
739 )
776 assert_routing(
740 assert_routing(
777 { :method => 'get',
741 { :method => 'get',
778 :path => "/projects/redmine/repository/changes/path/to/file.c" },
742 :path => "/projects/redmine/repository/changes/path/to/file.c" },
779 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
743 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
780 :path => %w[path to file.c] }
744 :path => %w[path to file.c] }
781 )
745 )
782 assert_routing(
746 assert_routing(
783 { :method => 'get',
747 { :method => 'get',
784 :path => "/projects/redmine/repository/statistics" },
748 :path => "/projects/redmine/repository/statistics" },
785 { :controller => 'repositories', :action => 'stats', :id => 'redmine' }
749 { :controller => 'repositories', :action => 'stats', :id => 'redmine' }
786 )
750 )
787 assert_routing(
751 assert_routing(
788 { :method => 'post',
752 { :method => 'post',
789 :path => "/projects/redmine/repository/edit" },
753 :path => "/projects/redmine/repository/edit" },
790 { :controller => 'repositories', :action => 'edit', :id => 'redmine' }
754 { :controller => 'repositories', :action => 'edit', :id => 'redmine' }
791 )
755 )
792 end
756 end
793
757
794 def test_roles
758 def test_roles
795 assert_routing(
759 assert_routing(
796 { :method => 'get', :path => "/roles" },
760 { :method => 'get', :path => "/roles" },
797 { :controller => 'roles', :action => 'index' }
761 { :controller => 'roles', :action => 'index' }
798 )
762 )
799 assert_routing(
763 assert_routing(
800 { :method => 'get', :path => "/roles/new" },
764 { :method => 'get', :path => "/roles/new" },
801 { :controller => 'roles', :action => 'new' }
765 { :controller => 'roles', :action => 'new' }
802 )
766 )
803 assert_routing(
767 assert_routing(
804 { :method => 'post', :path => "/roles" },
768 { :method => 'post', :path => "/roles" },
805 { :controller => 'roles', :action => 'create' }
769 { :controller => 'roles', :action => 'create' }
806 )
770 )
807 assert_routing(
771 assert_routing(
808 { :method => 'get', :path => "/roles/2/edit" },
772 { :method => 'get', :path => "/roles/2/edit" },
809 { :controller => 'roles', :action => 'edit', :id => '2' }
773 { :controller => 'roles', :action => 'edit', :id => '2' }
810 )
774 )
811 assert_routing(
775 assert_routing(
812 { :method => 'put', :path => "/roles/2" },
776 { :method => 'put', :path => "/roles/2" },
813 { :controller => 'roles', :action => 'update', :id => '2' }
777 { :controller => 'roles', :action => 'update', :id => '2' }
814 )
778 )
815 assert_routing(
779 assert_routing(
816 { :method => 'delete', :path => "/roles/2" },
780 { :method => 'delete', :path => "/roles/2" },
817 { :controller => 'roles', :action => 'destroy', :id => '2' }
781 { :controller => 'roles', :action => 'destroy', :id => '2' }
818 )
782 )
819 assert_routing(
783 assert_routing(
820 { :method => 'get', :path => "/roles/permissions" },
784 { :method => 'get', :path => "/roles/permissions" },
821 { :controller => 'roles', :action => 'permissions' }
785 { :controller => 'roles', :action => 'permissions' }
822 )
786 )
823 assert_routing(
787 assert_routing(
824 { :method => 'post', :path => "/roles/permissions" },
788 { :method => 'post', :path => "/roles/permissions" },
825 { :controller => 'roles', :action => 'permissions' }
789 { :controller => 'roles', :action => 'permissions' }
826 )
790 )
827 end
791 end
828
792
829 def test_timelogs_global
793 def test_timelogs_global
830 assert_routing(
794 assert_routing(
831 { :method => 'get', :path => "/time_entries" },
795 { :method => 'get', :path => "/time_entries" },
832 { :controller => 'timelog', :action => 'index' }
796 { :controller => 'timelog', :action => 'index' }
833 )
797 )
834 assert_routing(
798 assert_routing(
835 { :method => 'get', :path => "/time_entries.csv" },
799 { :method => 'get', :path => "/time_entries.csv" },
836 { :controller => 'timelog', :action => 'index', :format => 'csv' }
800 { :controller => 'timelog', :action => 'index', :format => 'csv' }
837 )
801 )
838 assert_routing(
802 assert_routing(
839 { :method => 'get', :path => "/time_entries.atom" },
803 { :method => 'get', :path => "/time_entries.atom" },
840 { :controller => 'timelog', :action => 'index', :format => 'atom' }
804 { :controller => 'timelog', :action => 'index', :format => 'atom' }
841 )
805 )
842 assert_routing(
806 assert_routing(
843 { :method => 'get', :path => "/time_entries/new" },
807 { :method => 'get', :path => "/time_entries/new" },
844 { :controller => 'timelog', :action => 'new' }
808 { :controller => 'timelog', :action => 'new' }
845 )
809 )
846 assert_routing(
810 assert_routing(
847 { :method => 'get', :path => "/time_entries/22/edit" },
811 { :method => 'get', :path => "/time_entries/22/edit" },
848 { :controller => 'timelog', :action => 'edit', :id => '22' }
812 { :controller => 'timelog', :action => 'edit', :id => '22' }
849 )
813 )
850 assert_routing(
814 assert_routing(
851 { :method => 'post', :path => "/time_entries" },
815 { :method => 'post', :path => "/time_entries" },
852 { :controller => 'timelog', :action => 'create' }
816 { :controller => 'timelog', :action => 'create' }
853 )
817 )
854 assert_routing(
818 assert_routing(
855 { :method => 'put', :path => "/time_entries/22" },
819 { :method => 'put', :path => "/time_entries/22" },
856 { :controller => 'timelog', :action => 'update', :id => '22' }
820 { :controller => 'timelog', :action => 'update', :id => '22' }
857 )
821 )
858 assert_routing(
822 assert_routing(
859 { :method => 'delete', :path => "/time_entries/55" },
823 { :method => 'delete', :path => "/time_entries/55" },
860 { :controller => 'timelog', :action => 'destroy', :id => '55' }
824 { :controller => 'timelog', :action => 'destroy', :id => '55' }
861 )
825 )
862 end
826 end
863
827
864 def test_timelogs_scoped_under_project
828 def test_timelogs_scoped_under_project
865 assert_routing(
829 assert_routing(
866 { :method => 'get', :path => "/projects/567/time_entries" },
830 { :method => 'get', :path => "/projects/567/time_entries" },
867 { :controller => 'timelog', :action => 'index', :project_id => '567' }
831 { :controller => 'timelog', :action => 'index', :project_id => '567' }
868 )
832 )
869 assert_routing(
833 assert_routing(
870 { :method => 'get', :path => "/projects/567/time_entries.csv" },
834 { :method => 'get', :path => "/projects/567/time_entries.csv" },
871 { :controller => 'timelog', :action => 'index', :project_id => '567',
835 { :controller => 'timelog', :action => 'index', :project_id => '567',
872 :format => 'csv' }
836 :format => 'csv' }
873 )
837 )
874 assert_routing(
838 assert_routing(
875 { :method => 'get', :path => "/projects/567/time_entries.atom" },
839 { :method => 'get', :path => "/projects/567/time_entries.atom" },
876 { :controller => 'timelog', :action => 'index', :project_id => '567',
840 { :controller => 'timelog', :action => 'index', :project_id => '567',
877 :format => 'atom' }
841 :format => 'atom' }
878 )
842 )
879 assert_routing(
843 assert_routing(
880 { :method => 'get', :path => "/projects/567/time_entries/new" },
844 { :method => 'get', :path => "/projects/567/time_entries/new" },
881 { :controller => 'timelog', :action => 'new', :project_id => '567' }
845 { :controller => 'timelog', :action => 'new', :project_id => '567' }
882 )
846 )
883 assert_routing(
847 assert_routing(
884 { :method => 'get', :path => "/projects/567/time_entries/22/edit" },
848 { :method => 'get', :path => "/projects/567/time_entries/22/edit" },
885 { :controller => 'timelog', :action => 'edit',
849 { :controller => 'timelog', :action => 'edit',
886 :id => '22', :project_id => '567' }
850 :id => '22', :project_id => '567' }
887 )
851 )
888 assert_routing(
852 assert_routing(
889 { :method => 'post', :path => "/projects/567/time_entries" },
853 { :method => 'post', :path => "/projects/567/time_entries" },
890 { :controller => 'timelog', :action => 'create',
854 { :controller => 'timelog', :action => 'create',
891 :project_id => '567' }
855 :project_id => '567' }
892 )
856 )
893 assert_routing(
857 assert_routing(
894 { :method => 'put', :path => "/projects/567/time_entries/22" },
858 { :method => 'put', :path => "/projects/567/time_entries/22" },
895 { :controller => 'timelog', :action => 'update',
859 { :controller => 'timelog', :action => 'update',
896 :id => '22', :project_id => '567' }
860 :id => '22', :project_id => '567' }
897 )
861 )
898 assert_routing(
862 assert_routing(
899 { :method => 'delete', :path => "/projects/567/time_entries/55" },
863 { :method => 'delete', :path => "/projects/567/time_entries/55" },
900 { :controller => 'timelog', :action => 'destroy',
864 { :controller => 'timelog', :action => 'destroy',
901 :id => '55', :project_id => '567' }
865 :id => '55', :project_id => '567' }
902 )
866 )
903 end
867 end
904
868
905 def test_timelogs_scoped_under_issues
869 def test_timelogs_scoped_under_issues
906 assert_routing(
870 assert_routing(
907 { :method => 'get', :path => "/issues/234/time_entries" },
871 { :method => 'get', :path => "/issues/234/time_entries" },
908 { :controller => 'timelog', :action => 'index', :issue_id => '234' }
872 { :controller => 'timelog', :action => 'index', :issue_id => '234' }
909 )
873 )
910 assert_routing(
874 assert_routing(
911 { :method => 'get', :path => "/issues/234/time_entries.csv" },
875 { :method => 'get', :path => "/issues/234/time_entries.csv" },
912 { :controller => 'timelog', :action => 'index', :issue_id => '234',
876 { :controller => 'timelog', :action => 'index', :issue_id => '234',
913 :format => 'csv' }
877 :format => 'csv' }
914 )
878 )
915 assert_routing(
879 assert_routing(
916 { :method => 'get', :path => "/issues/234/time_entries.atom" },
880 { :method => 'get', :path => "/issues/234/time_entries.atom" },
917 { :controller => 'timelog', :action => 'index', :issue_id => '234',
881 { :controller => 'timelog', :action => 'index', :issue_id => '234',
918 :format => 'atom' }
882 :format => 'atom' }
919 )
883 )
920 assert_routing(
884 assert_routing(
921 { :method => 'get', :path => "/issues/234/time_entries/new" },
885 { :method => 'get', :path => "/issues/234/time_entries/new" },
922 { :controller => 'timelog', :action => 'new', :issue_id => '234' }
886 { :controller => 'timelog', :action => 'new', :issue_id => '234' }
923 )
887 )
924 assert_routing(
888 assert_routing(
925 { :method => 'get', :path => "/issues/234/time_entries/22/edit" },
889 { :method => 'get', :path => "/issues/234/time_entries/22/edit" },
926 { :controller => 'timelog', :action => 'edit', :id => '22',
890 { :controller => 'timelog', :action => 'edit', :id => '22',
927 :issue_id => '234' }
891 :issue_id => '234' }
928 )
892 )
929 assert_routing(
893 assert_routing(
930 { :method => 'post', :path => "/issues/234/time_entries" },
894 { :method => 'post', :path => "/issues/234/time_entries" },
931 { :controller => 'timelog', :action => 'create', :issue_id => '234' }
895 { :controller => 'timelog', :action => 'create', :issue_id => '234' }
932 )
896 )
933 assert_routing(
897 assert_routing(
934 { :method => 'put', :path => "/issues/234/time_entries/22" },
898 { :method => 'put', :path => "/issues/234/time_entries/22" },
935 { :controller => 'timelog', :action => 'update', :id => '22',
899 { :controller => 'timelog', :action => 'update', :id => '22',
936 :issue_id => '234' }
900 :issue_id => '234' }
937 )
901 )
938 assert_routing(
902 assert_routing(
939 { :method => 'delete', :path => "/issues/234/time_entries/55" },
903 { :method => 'delete', :path => "/issues/234/time_entries/55" },
940 { :controller => 'timelog', :action => 'destroy', :id => '55',
904 { :controller => 'timelog', :action => 'destroy', :id => '55',
941 :issue_id => '234' }
905 :issue_id => '234' }
942 )
906 )
943 end
907 end
944
908
945 def test_timelogs_scoped_under_project_and_issues
909 def test_timelogs_scoped_under_project_and_issues
946 assert_routing(
910 assert_routing(
947 { :method => 'get',
911 { :method => 'get',
948 :path => "/projects/ecookbook/issues/234/time_entries" },
912 :path => "/projects/ecookbook/issues/234/time_entries" },
949 { :controller => 'timelog', :action => 'index',
913 { :controller => 'timelog', :action => 'index',
950 :issue_id => '234', :project_id => 'ecookbook' }
914 :issue_id => '234', :project_id => 'ecookbook' }
951 )
915 )
952 assert_routing(
916 assert_routing(
953 { :method => 'get',
917 { :method => 'get',
954 :path => "/projects/ecookbook/issues/234/time_entries.csv" },
918 :path => "/projects/ecookbook/issues/234/time_entries.csv" },
955 { :controller => 'timelog', :action => 'index',
919 { :controller => 'timelog', :action => 'index',
956 :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' }
920 :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' }
957 )
921 )
958 assert_routing(
922 assert_routing(
959 { :method => 'get',
923 { :method => 'get',
960 :path => "/projects/ecookbook/issues/234/time_entries.atom" },
924 :path => "/projects/ecookbook/issues/234/time_entries.atom" },
961 { :controller => 'timelog', :action => 'index',
925 { :controller => 'timelog', :action => 'index',
962 :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' }
926 :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' }
963 )
927 )
964 assert_routing(
928 assert_routing(
965 { :method => 'get',
929 { :method => 'get',
966 :path => "/projects/ecookbook/issues/234/time_entries/new" },
930 :path => "/projects/ecookbook/issues/234/time_entries/new" },
967 { :controller => 'timelog', :action => 'new',
931 { :controller => 'timelog', :action => 'new',
968 :issue_id => '234', :project_id => 'ecookbook' }
932 :issue_id => '234', :project_id => 'ecookbook' }
969 )
933 )
970 assert_routing(
934 assert_routing(
971 { :method => 'get',
935 { :method => 'get',
972 :path => "/projects/ecookbook/issues/234/time_entries/22/edit" },
936 :path => "/projects/ecookbook/issues/234/time_entries/22/edit" },
973 { :controller => 'timelog', :action => 'edit', :id => '22',
937 { :controller => 'timelog', :action => 'edit', :id => '22',
974 :issue_id => '234', :project_id => 'ecookbook' }
938 :issue_id => '234', :project_id => 'ecookbook' }
975 )
939 )
976 assert_routing(
940 assert_routing(
977 { :method => 'post',
941 { :method => 'post',
978 :path => "/projects/ecookbook/issues/234/time_entries" },
942 :path => "/projects/ecookbook/issues/234/time_entries" },
979 { :controller => 'timelog', :action => 'create',
943 { :controller => 'timelog', :action => 'create',
980 :issue_id => '234', :project_id => 'ecookbook' }
944 :issue_id => '234', :project_id => 'ecookbook' }
981 )
945 )
982 assert_routing(
946 assert_routing(
983 { :method => 'put',
947 { :method => 'put',
984 :path => "/projects/ecookbook/issues/234/time_entries/22" },
948 :path => "/projects/ecookbook/issues/234/time_entries/22" },
985 { :controller => 'timelog', :action => 'update', :id => '22',
949 { :controller => 'timelog', :action => 'update', :id => '22',
986 :issue_id => '234', :project_id => 'ecookbook' }
950 :issue_id => '234', :project_id => 'ecookbook' }
987 )
951 )
988 assert_routing(
952 assert_routing(
989 { :method => 'delete',
953 { :method => 'delete',
990 :path => "/projects/ecookbook/issues/234/time_entries/55" },
954 :path => "/projects/ecookbook/issues/234/time_entries/55" },
991 { :controller => 'timelog', :action => 'destroy', :id => '55',
955 { :controller => 'timelog', :action => 'destroy', :id => '55',
992 :issue_id => '234', :project_id => 'ecookbook' }
956 :issue_id => '234', :project_id => 'ecookbook' }
993 )
957 )
994 assert_routing(
958 assert_routing(
995 { :method => 'get',
959 { :method => 'get',
996 :path => "/time_entries/report" },
960 :path => "/time_entries/report" },
997 { :controller => 'timelog', :action => 'report' }
961 { :controller => 'timelog', :action => 'report' }
998 )
962 )
999 assert_routing(
963 assert_routing(
1000 { :method => 'get',
964 { :method => 'get',
1001 :path => "/projects/567/time_entries/report" },
965 :path => "/projects/567/time_entries/report" },
1002 { :controller => 'timelog', :action => 'report', :project_id => '567' }
966 { :controller => 'timelog', :action => 'report', :project_id => '567' }
1003 )
967 )
1004 assert_routing(
968 assert_routing(
1005 { :method => 'get',
969 { :method => 'get',
1006 :path => "/projects/567/time_entries/report.csv" },
970 :path => "/projects/567/time_entries/report.csv" },
1007 { :controller => 'timelog', :action => 'report', :project_id => '567',
971 { :controller => 'timelog', :action => 'report', :project_id => '567',
1008 :format => 'csv' }
972 :format => 'csv' }
1009 )
973 )
1010 end
974 end
1011
975
1012 def test_users
976 def test_users
1013 assert_routing(
977 assert_routing(
1014 { :method => 'get', :path => "/users" },
978 { :method => 'get', :path => "/users" },
1015 { :controller => 'users', :action => 'index' }
979 { :controller => 'users', :action => 'index' }
1016 )
980 )
1017 assert_routing(
981 assert_routing(
1018 { :method => 'get', :path => "/users.xml" },
982 { :method => 'get', :path => "/users.xml" },
1019 { :controller => 'users', :action => 'index', :format => 'xml' }
983 { :controller => 'users', :action => 'index', :format => 'xml' }
1020 )
984 )
1021 assert_routing(
985 assert_routing(
1022 { :method => 'get', :path => "/users/44" },
986 { :method => 'get', :path => "/users/44" },
1023 { :controller => 'users', :action => 'show', :id => '44' }
987 { :controller => 'users', :action => 'show', :id => '44' }
1024 )
988 )
1025 assert_routing(
989 assert_routing(
1026 { :method => 'get', :path => "/users/44.xml" },
990 { :method => 'get', :path => "/users/44.xml" },
1027 { :controller => 'users', :action => 'show', :id => '44',
991 { :controller => 'users', :action => 'show', :id => '44',
1028 :format => 'xml' }
992 :format => 'xml' }
1029 )
993 )
1030 assert_routing(
994 assert_routing(
1031 { :method => 'get', :path => "/users/current" },
995 { :method => 'get', :path => "/users/current" },
1032 { :controller => 'users', :action => 'show', :id => 'current' }
996 { :controller => 'users', :action => 'show', :id => 'current' }
1033 )
997 )
1034 assert_routing(
998 assert_routing(
1035 { :method => 'get', :path => "/users/current.xml" },
999 { :method => 'get', :path => "/users/current.xml" },
1036 { :controller => 'users', :action => 'show', :id => 'current',
1000 { :controller => 'users', :action => 'show', :id => 'current',
1037 :format => 'xml' }
1001 :format => 'xml' }
1038 )
1002 )
1039 assert_routing(
1003 assert_routing(
1040 { :method => 'get', :path => "/users/new" },
1004 { :method => 'get', :path => "/users/new" },
1041 { :controller => 'users', :action => 'new' }
1005 { :controller => 'users', :action => 'new' }
1042 )
1006 )
1043 assert_routing(
1007 assert_routing(
1044 { :method => 'get', :path => "/users/444/edit" },
1008 { :method => 'get', :path => "/users/444/edit" },
1045 { :controller => 'users', :action => 'edit', :id => '444' }
1009 { :controller => 'users', :action => 'edit', :id => '444' }
1046 )
1010 )
1047 assert_routing(
1011 assert_routing(
1048 { :method => 'post', :path => "/users" },
1012 { :method => 'post', :path => "/users" },
1049 { :controller => 'users', :action => 'create' }
1013 { :controller => 'users', :action => 'create' }
1050 )
1014 )
1051 assert_routing(
1015 assert_routing(
1052 { :method => 'post', :path => "/users.xml" },
1016 { :method => 'post', :path => "/users.xml" },
1053 { :controller => 'users', :action => 'create', :format => 'xml' }
1017 { :controller => 'users', :action => 'create', :format => 'xml' }
1054 )
1018 )
1055 assert_routing(
1019 assert_routing(
1056 { :method => 'put', :path => "/users/444" },
1020 { :method => 'put', :path => "/users/444" },
1057 { :controller => 'users', :action => 'update', :id => '444' }
1021 { :controller => 'users', :action => 'update', :id => '444' }
1058 )
1022 )
1059 assert_routing(
1023 assert_routing(
1060 { :method => 'put', :path => "/users/444.xml" },
1024 { :method => 'put', :path => "/users/444.xml" },
1061 { :controller => 'users', :action => 'update', :id => '444',
1025 { :controller => 'users', :action => 'update', :id => '444',
1062 :format => 'xml' }
1026 :format => 'xml' }
1063 )
1027 )
1064 assert_routing(
1028 assert_routing(
1065 { :method => 'delete', :path => "/users/44" },
1029 { :method => 'delete', :path => "/users/44" },
1066 { :controller => 'users', :action => 'destroy', :id => '44' }
1030 { :controller => 'users', :action => 'destroy', :id => '44' }
1067 )
1031 )
1068 assert_routing(
1032 assert_routing(
1069 { :method => 'delete', :path => "/users/44.xml" },
1033 { :method => 'delete', :path => "/users/44.xml" },
1070 { :controller => 'users', :action => 'destroy', :id => '44',
1034 { :controller => 'users', :action => 'destroy', :id => '44',
1071 :format => 'xml' }
1035 :format => 'xml' }
1072 )
1036 )
1073 assert_routing(
1037 assert_routing(
1074 { :method => 'post', :path => "/users/123/memberships" },
1038 { :method => 'post', :path => "/users/123/memberships" },
1075 { :controller => 'users', :action => 'edit_membership',
1039 { :controller => 'users', :action => 'edit_membership',
1076 :id => '123' }
1040 :id => '123' }
1077 )
1041 )
1078 assert_routing(
1042 assert_routing(
1079 { :method => 'put', :path => "/users/123/memberships/55" },
1043 { :method => 'put', :path => "/users/123/memberships/55" },
1080 { :controller => 'users', :action => 'edit_membership',
1044 { :controller => 'users', :action => 'edit_membership',
1081 :id => '123', :membership_id => '55' }
1045 :id => '123', :membership_id => '55' }
1082 )
1046 )
1083 assert_routing(
1047 assert_routing(
1084 { :method => 'delete', :path => "/users/123/memberships/55" },
1048 { :method => 'delete', :path => "/users/123/memberships/55" },
1085 { :controller => 'users', :action => 'destroy_membership',
1049 { :controller => 'users', :action => 'destroy_membership',
1086 :id => '123', :membership_id => '55' }
1050 :id => '123', :membership_id => '55' }
1087 )
1051 )
1088 end
1052 end
1089
1053
1090 def test_versions
1054 def test_versions
1091 # /projects/foo/versions is /projects/foo/roadmap
1055 # /projects/foo/versions is /projects/foo/roadmap
1092 assert_routing(
1056 assert_routing(
1093 { :method => 'get', :path => "/projects/foo/versions.xml" },
1057 { :method => 'get', :path => "/projects/foo/versions.xml" },
1094 { :controller => 'versions', :action => 'index',
1058 { :controller => 'versions', :action => 'index',
1095 :project_id => 'foo', :format => 'xml' }
1059 :project_id => 'foo', :format => 'xml' }
1096 )
1060 )
1097 assert_routing(
1061 assert_routing(
1098 { :method => 'get', :path => "/projects/foo/versions.json" },
1062 { :method => 'get', :path => "/projects/foo/versions.json" },
1099 { :controller => 'versions', :action => 'index',
1063 { :controller => 'versions', :action => 'index',
1100 :project_id => 'foo', :format => 'json' }
1064 :project_id => 'foo', :format => 'json' }
1101 )
1065 )
1102 assert_routing(
1066 assert_routing(
1103 { :method => 'get', :path => "/projects/foo/versions/new" },
1067 { :method => 'get', :path => "/projects/foo/versions/new" },
1104 { :controller => 'versions', :action => 'new',
1068 { :controller => 'versions', :action => 'new',
1105 :project_id => 'foo' }
1069 :project_id => 'foo' }
1106 )
1070 )
1107 assert_routing(
1071 assert_routing(
1108 { :method => 'post', :path => "/projects/foo/versions" },
1072 { :method => 'post', :path => "/projects/foo/versions" },
1109 { :controller => 'versions', :action => 'create',
1073 { :controller => 'versions', :action => 'create',
1110 :project_id => 'foo' }
1074 :project_id => 'foo' }
1111 )
1075 )
1112 assert_routing(
1076 assert_routing(
1113 { :method => 'post', :path => "/projects/foo/versions.xml" },
1077 { :method => 'post', :path => "/projects/foo/versions.xml" },
1114 { :controller => 'versions', :action => 'create',
1078 { :controller => 'versions', :action => 'create',
1115 :project_id => 'foo', :format => 'xml' }
1079 :project_id => 'foo', :format => 'xml' }
1116 )
1080 )
1117 assert_routing(
1081 assert_routing(
1118 { :method => 'post', :path => "/projects/foo/versions.json" },
1082 { :method => 'post', :path => "/projects/foo/versions.json" },
1119 { :controller => 'versions', :action => 'create',
1083 { :controller => 'versions', :action => 'create',
1120 :project_id => 'foo', :format => 'json' }
1084 :project_id => 'foo', :format => 'json' }
1121 )
1085 )
1122 assert_routing(
1086 assert_routing(
1123 { :method => 'get', :path => "/versions/1" },
1087 { :method => 'get', :path => "/versions/1" },
1124 { :controller => 'versions', :action => 'show', :id => '1' }
1088 { :controller => 'versions', :action => 'show', :id => '1' }
1125 )
1089 )
1126 assert_routing(
1090 assert_routing(
1127 { :method => 'get', :path => "/versions/1.xml" },
1091 { :method => 'get', :path => "/versions/1.xml" },
1128 { :controller => 'versions', :action => 'show', :id => '1',
1092 { :controller => 'versions', :action => 'show', :id => '1',
1129 :format => 'xml' }
1093 :format => 'xml' }
1130 )
1094 )
1131 assert_routing(
1095 assert_routing(
1132 { :method => 'get', :path => "/versions/1.json" },
1096 { :method => 'get', :path => "/versions/1.json" },
1133 { :controller => 'versions', :action => 'show', :id => '1',
1097 { :controller => 'versions', :action => 'show', :id => '1',
1134 :format => 'json' }
1098 :format => 'json' }
1135 )
1099 )
1136 assert_routing(
1100 assert_routing(
1137 { :method => 'get', :path => "/versions/1/edit" },
1101 { :method => 'get', :path => "/versions/1/edit" },
1138 { :controller => 'versions', :action => 'edit', :id => '1' }
1102 { :controller => 'versions', :action => 'edit', :id => '1' }
1139 )
1103 )
1140 assert_routing(
1104 assert_routing(
1141 { :method => 'put', :path => "/versions/1" },
1105 { :method => 'put', :path => "/versions/1" },
1142 { :controller => 'versions', :action => 'update', :id => '1' }
1106 { :controller => 'versions', :action => 'update', :id => '1' }
1143 )
1107 )
1144 assert_routing(
1108 assert_routing(
1145 { :method => 'put', :path => "/versions/1.xml" },
1109 { :method => 'put', :path => "/versions/1.xml" },
1146 { :controller => 'versions', :action => 'update', :id => '1',
1110 { :controller => 'versions', :action => 'update', :id => '1',
1147 :format => 'xml' }
1111 :format => 'xml' }
1148 )
1112 )
1149 assert_routing(
1113 assert_routing(
1150 { :method => 'put', :path => "/versions/1.json" },
1114 { :method => 'put', :path => "/versions/1.json" },
1151 { :controller => 'versions', :action => 'update', :id => '1',
1115 { :controller => 'versions', :action => 'update', :id => '1',
1152 :format => 'json' }
1116 :format => 'json' }
1153 )
1117 )
1154 assert_routing(
1118 assert_routing(
1155 { :method => 'delete', :path => "/versions/1" },
1119 { :method => 'delete', :path => "/versions/1" },
1156 { :controller => 'versions', :action => 'destroy', :id => '1' }
1120 { :controller => 'versions', :action => 'destroy', :id => '1' }
1157 )
1121 )
1158 assert_routing(
1122 assert_routing(
1159 { :method => 'delete', :path => "/versions/1.xml" },
1123 { :method => 'delete', :path => "/versions/1.xml" },
1160 { :controller => 'versions', :action => 'destroy', :id => '1',
1124 { :controller => 'versions', :action => 'destroy', :id => '1',
1161 :format => 'xml' }
1125 :format => 'xml' }
1162 )
1126 )
1163 assert_routing(
1127 assert_routing(
1164 { :method => 'delete', :path => "/versions/1.json" },
1128 { :method => 'delete', :path => "/versions/1.json" },
1165 { :controller => 'versions', :action => 'destroy', :id => '1',
1129 { :controller => 'versions', :action => 'destroy', :id => '1',
1166 :format => 'json' }
1130 :format => 'json' }
1167 )
1131 )
1168 assert_routing(
1132 assert_routing(
1169 { :method => 'put', :path => "/projects/foo/versions/close_completed" },
1133 { :method => 'put', :path => "/projects/foo/versions/close_completed" },
1170 { :controller => 'versions', :action => 'close_completed',
1134 { :controller => 'versions', :action => 'close_completed',
1171 :project_id => 'foo' }
1135 :project_id => 'foo' }
1172 )
1136 )
1173 assert_routing(
1137 assert_routing(
1174 { :method => 'post', :path => "/versions/1/status_by" },
1138 { :method => 'post', :path => "/versions/1/status_by" },
1175 { :controller => 'versions', :action => 'status_by', :id => '1' }
1139 { :controller => 'versions', :action => 'status_by', :id => '1' }
1176 )
1140 )
1177 end
1141 end
1178
1142
1179 def test_welcome
1143 def test_welcome
1180 assert_routing(
1144 assert_routing(
1181 { :method => 'get', :path => "/robots.txt" },
1145 { :method => 'get', :path => "/robots.txt" },
1182 { :controller => 'welcome', :action => 'robots' }
1146 { :controller => 'welcome', :action => 'robots' }
1183 )
1147 )
1184 end
1148 end
1185
1149
1186 def test_wiki_singular_projects_pages
1150 def test_wiki_singular_projects_pages
1187 assert_routing(
1151 assert_routing(
1188 { :method => 'get', :path => "/projects/567/wiki" },
1152 { :method => 'get', :path => "/projects/567/wiki" },
1189 { :controller => 'wiki', :action => 'show', :project_id => '567' }
1153 { :controller => 'wiki', :action => 'show', :project_id => '567' }
1190 )
1154 )
1191 assert_routing(
1155 assert_routing(
1192 { :method => 'get', :path => "/projects/567/wiki/lalala" },
1156 { :method => 'get', :path => "/projects/567/wiki/lalala" },
1193 { :controller => 'wiki', :action => 'show', :project_id => '567',
1157 { :controller => 'wiki', :action => 'show', :project_id => '567',
1194 :id => 'lalala' }
1158 :id => 'lalala' }
1195 )
1159 )
1196 assert_routing(
1160 assert_routing(
1197 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
1161 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
1198 { :controller => 'wiki', :action => 'edit', :project_id => '567',
1162 { :controller => 'wiki', :action => 'edit', :project_id => '567',
1199 :id => 'my_page' }
1163 :id => 'my_page' }
1200 )
1164 )
1201 assert_routing(
1165 assert_routing(
1202 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
1166 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
1203 { :controller => 'wiki', :action => 'history', :project_id => '1',
1167 { :controller => 'wiki', :action => 'history', :project_id => '1',
1204 :id => 'CookBook_documentation' }
1168 :id => 'CookBook_documentation' }
1205 )
1169 )
1206 assert_routing(
1170 assert_routing(
1207 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
1171 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
1208 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1172 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1209 :id => 'CookBook_documentation' }
1173 :id => 'CookBook_documentation' }
1210 )
1174 )
1211 assert_routing(
1175 assert_routing(
1212 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
1176 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
1213 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1177 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1214 :id => 'CookBook_documentation', :version => '2' }
1178 :id => 'CookBook_documentation', :version => '2' }
1215 )
1179 )
1216 assert_routing(
1180 assert_routing(
1217 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
1181 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
1218 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1182 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1219 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
1183 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
1220 )
1184 )
1221 assert_routing(
1185 assert_routing(
1222 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
1186 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
1223 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
1187 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
1224 :id => 'CookBook_documentation', :version => '2' }
1188 :id => 'CookBook_documentation', :version => '2' }
1225 )
1189 )
1226 assert_routing(
1190 assert_routing(
1227 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
1191 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
1228 { :controller => 'wiki', :action => 'rename', :project_id => '22',
1192 { :controller => 'wiki', :action => 'rename', :project_id => '22',
1229 :id => 'ladida' }
1193 :id => 'ladida' }
1230 )
1194 )
1231 assert_routing(
1195 assert_routing(
1232 { :method => 'get', :path => "/projects/567/wiki/index" },
1196 { :method => 'get', :path => "/projects/567/wiki/index" },
1233 { :controller => 'wiki', :action => 'index', :project_id => '567' }
1197 { :controller => 'wiki', :action => 'index', :project_id => '567' }
1234 )
1198 )
1235 assert_routing(
1199 assert_routing(
1236 { :method => 'get', :path => "/projects/567/wiki/date_index" },
1200 { :method => 'get', :path => "/projects/567/wiki/date_index" },
1237 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
1201 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
1238 )
1202 )
1239 assert_routing(
1203 assert_routing(
1240 { :method => 'get', :path => "/projects/567/wiki/export" },
1204 { :method => 'get', :path => "/projects/567/wiki/export" },
1241 { :controller => 'wiki', :action => 'export', :project_id => '567' }
1205 { :controller => 'wiki', :action => 'export', :project_id => '567' }
1242 )
1206 )
1243 assert_routing(
1207 assert_routing(
1244 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
1208 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
1245 { :controller => 'wiki', :action => 'preview', :project_id => '567',
1209 { :controller => 'wiki', :action => 'preview', :project_id => '567',
1246 :id => 'CookBook_documentation' }
1210 :id => 'CookBook_documentation' }
1247 )
1211 )
1248 assert_routing(
1212 assert_routing(
1249 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
1213 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
1250 { :controller => 'wiki', :action => 'rename', :project_id => '22',
1214 { :controller => 'wiki', :action => 'rename', :project_id => '22',
1251 :id => 'ladida' }
1215 :id => 'ladida' }
1252 )
1216 )
1253 assert_routing(
1217 assert_routing(
1254 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
1218 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
1255 { :controller => 'wiki', :action => 'protect', :project_id => '22',
1219 { :controller => 'wiki', :action => 'protect', :project_id => '22',
1256 :id => 'ladida' }
1220 :id => 'ladida' }
1257 )
1221 )
1258 assert_routing(
1222 assert_routing(
1259 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
1223 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
1260 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
1224 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
1261 :id => 'ladida' }
1225 :id => 'ladida' }
1262 )
1226 )
1263 assert_routing(
1227 assert_routing(
1264 { :method => 'put', :path => "/projects/567/wiki/my_page" },
1228 { :method => 'put', :path => "/projects/567/wiki/my_page" },
1265 { :controller => 'wiki', :action => 'update', :project_id => '567',
1229 { :controller => 'wiki', :action => 'update', :project_id => '567',
1266 :id => 'my_page' }
1230 :id => 'my_page' }
1267 )
1231 )
1268 assert_routing(
1232 assert_routing(
1269 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
1233 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
1270 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
1234 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
1271 :id => 'ladida' }
1235 :id => 'ladida' }
1272 )
1236 )
1273 end
1237 end
1274
1238
1275 def test_wikis_plural_admin_setup
1239 def test_wikis_plural_admin_setup
1276 assert_routing(
1240 assert_routing(
1277 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
1241 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
1278 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
1242 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
1279 )
1243 )
1280 assert_routing(
1244 assert_routing(
1281 { :method => 'post', :path => "/projects/ladida/wiki" },
1245 { :method => 'post', :path => "/projects/ladida/wiki" },
1282 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
1246 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
1283 )
1247 )
1284 assert_routing(
1248 assert_routing(
1285 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
1249 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
1286 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
1250 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
1287 )
1251 )
1288 end
1252 end
1289 end
1253 end
General Comments 0
You need to be logged in to leave comments. Login now