##// END OF EJS Templates
test: replace "should_route" of "activities" to "assert_routing" at integration/routing_test.rb...
Toshi MARUYAMA -
r8081:0b4aed008c96
parent child
Show More
@@ -1,458 +1,464
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../test_helper', __FILE__)
19 19
20 20 class RoutingTest < ActionController::IntegrationTest
21 context "activities" do
22 should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil
23 should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom'
21 def test_activities
22 assert_routing(
23 { :method => 'get', :path => "/activity" },
24 { :controller => 'activities', :action => 'index', :id => nil }
25 )
26 assert_routing(
27 { :method => 'get', :path => "/activity.atom" },
28 { :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' }
29 )
24 30 end
25 31
26 32 context "attachments" do
27 33 should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1'
28 34 should_route :get, "/attachments/1.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml'
29 35 should_route :get, "/attachments/1.json", :controller => 'attachments', :action => 'show', :id => '1', :format => 'json'
30 36 should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext'
31 37 should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1'
32 38 should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext'
33 39 end
34 40
35 41 context "boards" do
36 42 should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination'
37 43 should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
38 44 should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44'
39 45 should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom'
40 46 should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
41 47
42 48 should_route :post, "/projects/world_domination/boards", :controller => 'boards', :action => 'create', :project_id => 'world_domination'
43 49 should_route :put, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44'
44 50 should_route :delete, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44'
45 51
46 52 end
47 53
48 54 context "custom_fields" do
49 55 should_route :get, "/custom_fields", :controller => 'custom_fields', :action => 'index'
50 56 should_route :get, "/custom_fields/new", :controller => 'custom_fields', :action => 'new'
51 57 should_route :post, "/custom_fields", :controller => 'custom_fields', :action => 'create'
52 58 should_route :get, "/custom_fields/2/edit", :controller => 'custom_fields', :action => 'edit', :id => 2
53 59 should_route :put, "/custom_fields/2", :controller => 'custom_fields', :action => 'update', :id => 2
54 60 should_route :delete, "/custom_fields/2", :controller => 'custom_fields', :action => 'destroy', :id => 2
55 61 end
56 62
57 63 context "documents" do
58 64 should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
59 65 should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
60 66 should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
61 67 should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
62 68
63 69 should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567'
64 70 should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22'
65 71 should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22'
66 72
67 73 should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22'
68 74 end
69 75
70 76 context "roles" do
71 77 should_route :get, "/enumerations", :controller => 'enumerations', :action => 'index'
72 78 should_route :get, "/enumerations/new", :controller => 'enumerations', :action => 'new'
73 79 should_route :post, "/enumerations", :controller => 'enumerations', :action => 'create'
74 80 should_route :get, "/enumerations/2/edit", :controller => 'enumerations', :action => 'edit', :id => 2
75 81 should_route :put, "/enumerations/2", :controller => 'enumerations', :action => 'update', :id => 2
76 82 should_route :delete, "/enumerations/2", :controller => 'enumerations', :action => 'destroy', :id => 2
77 83 end
78 84
79 85 context "groups" do
80 86 should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567'
81 87 should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12'
82 88 end
83 89
84 90 context "issues" do
85 91 # REST actions
86 92 should_route :get, "/issues", :controller => 'issues', :action => 'index'
87 93 should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf'
88 94 should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom'
89 95 should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml'
90 96 should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23'
91 97 should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf'
92 98 should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom'
93 99 should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml'
94 100 should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64'
95 101 should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf'
96 102 should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom'
97 103 should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml'
98 104
99 105 should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
100 106 # issue form update
101 107 should_route :post, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
102 108 should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
103 109 should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
104 110
105 111 should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
106 112 should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
107 113
108 114 should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
109 115
110 116 # Extra actions
111 117 should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'
112 118
113 119 should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new'
114 120 should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create'
115 121
116 122 should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1'
117 123
118 124 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
119 125 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
120 126
121 127 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
122 128 should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf'
123 129 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
124 130 should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf'
125 131
126 132 should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues'
127 133
128 134 should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
129 135 should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
130 136 should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
131 137 should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
132 138
133 139 should_route :get, "/issues/changes", :controller => 'journals', :action => 'index'
134 140
135 141 should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit'
136 142 should_route :post, "/issues/bulk_update", :controller => 'issues', :action => 'bulk_update'
137 143 end
138 144
139 145 context "issue categories" do
140 146 should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo'
141 147 should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml'
142 148 should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json'
143 149
144 150 should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo'
145 151
146 152 should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo'
147 153 should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml'
148 154 should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json'
149 155
150 156 should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1'
151 157 should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml'
152 158 should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json'
153 159
154 160 should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1'
155 161
156 162 should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1'
157 163 should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml'
158 164 should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json'
159 165
160 166 should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1'
161 167 should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml'
162 168 should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json'
163 169 end
164 170
165 171 context "issue relations" do
166 172 should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1'
167 173 should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml'
168 174 should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json'
169 175
170 176 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1'
171 177 should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml'
172 178 should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json'
173 179
174 180 should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23'
175 181 should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml'
176 182 should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json'
177 183
178 184 should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23'
179 185 should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml'
180 186 should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json'
181 187 end
182 188
183 189 context "issue reports" do
184 190 should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567'
185 191 should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to'
186 192 end
187 193
188 194 context "members" do
189 195 should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234'
190 196 end
191 197
192 198 context "messages" do
193 199 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
194 200 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
195 201 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
196 202
197 203 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
198 204 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
199 205 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
200 206 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
201 207 end
202 208
203 209 context "news" do
204 210 should_route :get, "/news", :controller => 'news', :action => 'index'
205 211 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
206 212 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
207 213 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
208 214 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
209 215 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
210 216 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
211 217 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
212 218 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
213 219 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
214 220 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
215 221 should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
216 222 should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
217 223
218 224 should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
219 225 should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
220 226
221 227 should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567'
222 228
223 229 should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567'
224 230 should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15'
225 231 end
226 232
227 233 context "projects" do
228 234 should_route :get, "/projects", :controller => 'projects', :action => 'index'
229 235 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
230 236 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
231 237 should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
232 238 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
233 239 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
234 240 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
235 241 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
236 242 should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33'
237 243 should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33'
238 244 should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
239 245 should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
240 246 should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
241 247
242 248 should_route :post, "/projects", :controller => 'projects', :action => 'create'
243 249 should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml'
244 250 should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33'
245 251 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
246 252 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
247 253
248 254 should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64'
249 255 should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223'
250 256 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml'
251 257
252 258 should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64'
253 259 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
254 260 should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64'
255 261 end
256 262
257 263 context "queries" do
258 264 should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml'
259 265 should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json'
260 266
261 267 should_route :get, "/queries/new", :controller => 'queries', :action => 'new'
262 268 should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine'
263 269
264 270 should_route :post, "/queries", :controller => 'queries', :action => 'create'
265 271 should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine'
266 272
267 273 should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1'
268 274
269 275 should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1'
270 276
271 277 should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1'
272 278 end
273 279
274 280 context "repositories" do
275 281 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
276 282 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
277 283 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
278 284 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
279 285 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
280 286 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
281 287 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
282 288 should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c]
283 289 should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
284 290 should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c]
285 291 should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c]
286 292 should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
287 293 should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw'
288 294 should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw'
289 295 should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c]
290 296 should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c]
291 297 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
292 298
293 299 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
294 300 end
295 301
296 302 context "roles" do
297 303 should_route :get, "/roles", :controller => 'roles', :action => 'index'
298 304 should_route :get, "/roles/new", :controller => 'roles', :action => 'new'
299 305 should_route :post, "/roles", :controller => 'roles', :action => 'create'
300 306 should_route :get, "/roles/2/edit", :controller => 'roles', :action => 'edit', :id => 2
301 307 should_route :put, "/roles/2", :controller => 'roles', :action => 'update', :id => 2
302 308 should_route :delete, "/roles/2", :controller => 'roles', :action => 'destroy', :id => 2
303 309 should_route :get, "/roles/permissions", :controller => 'roles', :action => 'permissions'
304 310 should_route :post, "/roles/permissions", :controller => 'roles', :action => 'permissions'
305 311 end
306 312
307 313 context "timelogs (global)" do
308 314 should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
309 315 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
310 316 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
311 317 should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
312 318 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
313 319
314 320 should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
315 321
316 322 should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
317 323
318 324 should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
319 325 end
320 326
321 327 context "timelogs (scoped under project)" do
322 328 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
323 329 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
324 330 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
325 331 should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
326 332 should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
327 333
328 334 should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
329 335
330 336 should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
331 337
332 338 should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
333 339 end
334 340
335 341 context "timelogs (scoped under issues)" do
336 342 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234'
337 343 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv'
338 344 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom'
339 345 should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234'
340 346 should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234'
341 347
342 348 should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234'
343 349
344 350 should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234'
345 351
346 352 should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234'
347 353 end
348 354
349 355 context "timelogs (scoped under project and issues)" do
350 356 should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
351 357 should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
352 358 should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
353 359 should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
354 360 should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
355 361
356 362 should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
357 363
358 364 should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
359 365
360 366 should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
361 367
362 368 should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
363 369 should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
364 370 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
365 371 end
366 372
367 373 context "users" do
368 374 should_route :get, "/users", :controller => 'users', :action => 'index'
369 375 should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml'
370 376 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
371 377 should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml'
372 378 should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current'
373 379 should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml'
374 380 should_route :get, "/users/new", :controller => 'users', :action => 'new'
375 381 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
376 382
377 383 should_route :post, "/users", :controller => 'users', :action => 'create'
378 384 should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml'
379 385
380 386 should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
381 387 should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml'
382 388
383 389 should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44'
384 390 should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml'
385 391
386 392 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
387 393 should_route :put, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
388 394 should_route :delete, "/users/123/memberships/55", :controller => 'users', :action => 'destroy_membership', :id => '123', :membership_id => '55'
389 395 end
390 396
391 397 context "versions" do
392 398 # /projects/foo/versions is /projects/foo/roadmap
393 399 should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml'
394 400 should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json'
395 401
396 402 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
397 403
398 404 should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo'
399 405 should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml'
400 406 should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json'
401 407
402 408 should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1'
403 409 should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml'
404 410 should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json'
405 411
406 412 should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1'
407 413
408 414 should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1'
409 415 should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml'
410 416 should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json'
411 417
412 418 should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1'
413 419 should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml'
414 420 should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json'
415 421
416 422 should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo'
417 423 should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1'
418 424 end
419 425
420 426 context "welcome" do
421 427 should_route :get, "/robots.txt", :controller => 'welcome', :action => 'robots'
422 428 end
423 429
424 430 context "wiki (singular, project's pages)" do
425 431 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
426 432 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala'
427 433 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page'
428 434 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation'
429 435 should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation'
430 436 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
431 437 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1'
432 438 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
433 439 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
434 440 should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
435 441 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
436 442 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
437 443
438 444 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation'
439 445 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
440 446 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida'
441 447 should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida'
442 448
443 449 should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page'
444 450
445 451 should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida'
446 452 end
447 453
448 454 context "wikis (plural, admin setup)" do
449 455 should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
450 456
451 457 should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida'
452 458 should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
453 459 end
454 460
455 461 context "administration panel" do
456 462 should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects'
457 463 end
458 464 end
General Comments 0
You need to be logged in to leave comments. Login now