@@ -1,445 +1,443 | |||
|
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 | 21 | context "activities" do |
|
22 | 22 | should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil |
|
23 | 23 | should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' |
|
24 | 24 | end |
|
25 | 25 | |
|
26 | 26 | context "attachments" do |
|
27 | 27 | should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1' |
|
28 | 28 | should_route :get, "/attachments/1.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' |
|
29 | 29 | should_route :get, "/attachments/1.json", :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' |
|
30 | 30 | should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext' |
|
31 | 31 | should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1' |
|
32 | 32 | should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext' |
|
33 | 33 | end |
|
34 | 34 | |
|
35 | 35 | context "boards" do |
|
36 | 36 | should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination' |
|
37 | 37 | should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination' |
|
38 | 38 | should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44' |
|
39 | 39 | should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom' |
|
40 | 40 | should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44' |
|
41 | 41 | |
|
42 | 42 | should_route :post, "/projects/world_domination/boards", :controller => 'boards', :action => 'create', :project_id => 'world_domination' |
|
43 | 43 | should_route :put, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44' |
|
44 | 44 | should_route :delete, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' |
|
45 | 45 | |
|
46 | 46 | end |
|
47 | 47 | |
|
48 | 48 | context "custom_fields" do |
|
49 | 49 | should_route :get, "/custom_fields", :controller => 'custom_fields', :action => 'index' |
|
50 | 50 | should_route :get, "/custom_fields/new", :controller => 'custom_fields', :action => 'new' |
|
51 | 51 | should_route :post, "/custom_fields", :controller => 'custom_fields', :action => 'create' |
|
52 | 52 | should_route :get, "/custom_fields/2/edit", :controller => 'custom_fields', :action => 'edit', :id => 2 |
|
53 | 53 | should_route :put, "/custom_fields/2", :controller => 'custom_fields', :action => 'update', :id => 2 |
|
54 | 54 | should_route :delete, "/custom_fields/2", :controller => 'custom_fields', :action => 'destroy', :id => 2 |
|
55 | 55 | end |
|
56 | 56 | |
|
57 | 57 | context "documents" do |
|
58 | 58 | should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567' |
|
59 | 59 | should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' |
|
60 | 60 | should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22' |
|
61 | 61 | should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22' |
|
62 | 62 | |
|
63 | 63 | should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567' |
|
64 | 64 | should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22' |
|
65 | 65 | should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22' |
|
66 | 66 | |
|
67 | 67 | should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22' |
|
68 | 68 | end |
|
69 | 69 | |
|
70 | 70 | context "groups" do |
|
71 | 71 | should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567' |
|
72 | 72 | should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' |
|
73 | 73 | end |
|
74 | 74 | |
|
75 | 75 | context "issues" do |
|
76 | 76 | # REST actions |
|
77 | 77 | should_route :get, "/issues", :controller => 'issues', :action => 'index' |
|
78 | 78 | should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf' |
|
79 | 79 | should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom' |
|
80 | 80 | should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml' |
|
81 | 81 | should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23' |
|
82 | 82 | should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf' |
|
83 | 83 | should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom' |
|
84 | 84 | should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml' |
|
85 | 85 | should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64' |
|
86 | 86 | should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf' |
|
87 | 87 | should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom' |
|
88 | 88 | should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' |
|
89 | 89 | |
|
90 | 90 | should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' |
|
91 | 91 | should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' |
|
92 | 92 | should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml' |
|
93 | 93 | |
|
94 | 94 | should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64' |
|
95 | 95 | should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml' |
|
96 | 96 | |
|
97 | # TODO: Should use DELETE | |
|
98 | should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64' | |
|
99 | 97 | should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml' |
|
100 | 98 | |
|
101 | 99 | # Extra actions |
|
102 | 100 | should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64' |
|
103 | 101 | |
|
104 | 102 | should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new' |
|
105 | 103 | should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create' |
|
106 | 104 | |
|
107 | 105 | should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1' |
|
108 | 106 | |
|
109 | 107 | should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show' |
|
110 | 108 | should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name' |
|
111 | 109 | |
|
112 | 110 | should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show' |
|
113 | 111 | should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf' |
|
114 | 112 | should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name' |
|
115 | 113 | should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf' |
|
116 | 114 | |
|
117 | 115 | should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues' |
|
118 | 116 | |
|
119 | 117 | should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' |
|
120 | 118 | should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' |
|
121 | 119 | should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' |
|
122 | 120 | should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' |
|
123 | 121 | |
|
124 | 122 | should_route :get, "/issues/changes", :controller => 'journals', :action => 'index' |
|
125 | 123 | |
|
126 | 124 | should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit' |
|
127 | 125 | should_route :post, "/issues/bulk_update", :controller => 'issues', :action => 'bulk_update' |
|
128 | 126 | end |
|
129 | 127 | |
|
130 | 128 | context "issue categories" do |
|
131 | 129 | should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo' |
|
132 | 130 | should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml' |
|
133 | 131 | should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json' |
|
134 | 132 | |
|
135 | 133 | should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo' |
|
136 | 134 | |
|
137 | 135 | should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo' |
|
138 | 136 | should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml' |
|
139 | 137 | should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json' |
|
140 | 138 | |
|
141 | 139 | should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1' |
|
142 | 140 | should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml' |
|
143 | 141 | should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json' |
|
144 | 142 | |
|
145 | 143 | should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1' |
|
146 | 144 | |
|
147 | 145 | should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1' |
|
148 | 146 | should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml' |
|
149 | 147 | should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json' |
|
150 | 148 | |
|
151 | 149 | should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1' |
|
152 | 150 | should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml' |
|
153 | 151 | should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json' |
|
154 | 152 | end |
|
155 | 153 | |
|
156 | 154 | context "issue relations" do |
|
157 | 155 | should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1' |
|
158 | 156 | should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml' |
|
159 | 157 | should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json' |
|
160 | 158 | |
|
161 | 159 | should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1' |
|
162 | 160 | should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml' |
|
163 | 161 | should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json' |
|
164 | 162 | |
|
165 | 163 | should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23' |
|
166 | 164 | should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml' |
|
167 | 165 | should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json' |
|
168 | 166 | |
|
169 | 167 | should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23' |
|
170 | 168 | should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml' |
|
171 | 169 | should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json' |
|
172 | 170 | end |
|
173 | 171 | |
|
174 | 172 | context "issue reports" do |
|
175 | 173 | should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' |
|
176 | 174 | should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' |
|
177 | 175 | end |
|
178 | 176 | |
|
179 | 177 | context "members" do |
|
180 | 178 | should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234' |
|
181 | 179 | end |
|
182 | 180 | |
|
183 | 181 | context "messages" do |
|
184 | 182 | should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22' |
|
185 | 183 | should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
186 | 184 | should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
187 | 185 | |
|
188 | 186 | should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
189 | 187 | should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
190 | 188 | should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22' |
|
191 | 189 | should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22' |
|
192 | 190 | end |
|
193 | 191 | |
|
194 | 192 | context "news" do |
|
195 | 193 | should_route :get, "/news", :controller => 'news', :action => 'index' |
|
196 | 194 | should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom' |
|
197 | 195 | should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml' |
|
198 | 196 | should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json' |
|
199 | 197 | should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567' |
|
200 | 198 | should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567' |
|
201 | 199 | should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567' |
|
202 | 200 | should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567' |
|
203 | 201 | should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2' |
|
204 | 202 | should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567' |
|
205 | 203 | should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234' |
|
206 | 204 | should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567' |
|
207 | 205 | should_route :get, "/news/preview", :controller => 'previews', :action => 'news' |
|
208 | 206 | |
|
209 | 207 | should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567' |
|
210 | 208 | should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567' |
|
211 | 209 | |
|
212 | 210 | should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567' |
|
213 | 211 | |
|
214 | 212 | should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567' |
|
215 | 213 | should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15' |
|
216 | 214 | end |
|
217 | 215 | |
|
218 | 216 | context "projects" do |
|
219 | 217 | should_route :get, "/projects", :controller => 'projects', :action => 'index' |
|
220 | 218 | should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom' |
|
221 | 219 | should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml' |
|
222 | 220 | should_route :get, "/projects/new", :controller => 'projects', :action => 'new' |
|
223 | 221 | should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test' |
|
224 | 222 | should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml' |
|
225 | 223 | should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223' |
|
226 | 224 | should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members' |
|
227 | 225 | should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33' |
|
228 | 226 | should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33' |
|
229 | 227 | should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33' |
|
230 | 228 | should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33' |
|
231 | 229 | should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom' |
|
232 | 230 | |
|
233 | 231 | should_route :post, "/projects", :controller => 'projects', :action => 'create' |
|
234 | 232 | should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml' |
|
235 | 233 | should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33' |
|
236 | 234 | should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64' |
|
237 | 235 | should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64' |
|
238 | 236 | |
|
239 | 237 | should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64' |
|
240 | 238 | should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223' |
|
241 | 239 | should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml' |
|
242 | 240 | |
|
243 | 241 | should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64' |
|
244 | 242 | should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml' |
|
245 | 243 | should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64' |
|
246 | 244 | end |
|
247 | 245 | |
|
248 | 246 | context "queries" do |
|
249 | 247 | should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml' |
|
250 | 248 | should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json' |
|
251 | 249 | |
|
252 | 250 | should_route :get, "/queries/new", :controller => 'queries', :action => 'new' |
|
253 | 251 | should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' |
|
254 | 252 | |
|
255 | 253 | should_route :post, "/queries", :controller => 'queries', :action => 'create' |
|
256 | 254 | should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine' |
|
257 | 255 | |
|
258 | 256 | should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1' |
|
259 | 257 | |
|
260 | 258 | should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1' |
|
261 | 259 | |
|
262 | 260 | should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1' |
|
263 | 261 | end |
|
264 | 262 | |
|
265 | 263 | context "repositories" do |
|
266 | 264 | should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine' |
|
267 | 265 | should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
268 | 266 | should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine' |
|
269 | 267 | should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom' |
|
270 | 268 | should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457' |
|
271 | 269 | should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457' |
|
272 | 270 | should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff' |
|
273 | 271 | should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c] |
|
274 | 272 | 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' |
|
275 | 273 | should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c] |
|
276 | 274 | should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c] |
|
277 | 275 | 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' |
|
278 | 276 | 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' |
|
279 | 277 | 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' |
|
280 | 278 | should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c] |
|
281 | 279 | should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c] |
|
282 | 280 | should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine' |
|
283 | 281 | |
|
284 | 282 | should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
285 | 283 | end |
|
286 | 284 | |
|
287 | 285 | context "roles" do |
|
288 | 286 | should_route :get, "/roles", :controller => 'roles', :action => 'index' |
|
289 | 287 | should_route :get, "/roles/new", :controller => 'roles', :action => 'new' |
|
290 | 288 | should_route :post, "/roles", :controller => 'roles', :action => 'create' |
|
291 | 289 | should_route :get, "/roles/2/edit", :controller => 'roles', :action => 'edit', :id => 2 |
|
292 | 290 | should_route :put, "/roles/2", :controller => 'roles', :action => 'update', :id => 2 |
|
293 | 291 | should_route :delete, "/roles/2", :controller => 'roles', :action => 'destroy', :id => 2 |
|
294 | 292 | should_route :get, "/roles/permissions", :controller => 'roles', :action => 'permissions' |
|
295 | 293 | should_route :post, "/roles/permissions", :controller => 'roles', :action => 'permissions' |
|
296 | 294 | end |
|
297 | 295 | |
|
298 | 296 | context "timelogs (global)" do |
|
299 | 297 | should_route :get, "/time_entries", :controller => 'timelog', :action => 'index' |
|
300 | 298 | should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv' |
|
301 | 299 | should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom' |
|
302 | 300 | should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new' |
|
303 | 301 | should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22' |
|
304 | 302 | |
|
305 | 303 | should_route :post, "/time_entries", :controller => 'timelog', :action => 'create' |
|
306 | 304 | |
|
307 | 305 | should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22' |
|
308 | 306 | |
|
309 | 307 | should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55' |
|
310 | 308 | end |
|
311 | 309 | |
|
312 | 310 | context "timelogs (scoped under project)" do |
|
313 | 311 | should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567' |
|
314 | 312 | should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv' |
|
315 | 313 | should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom' |
|
316 | 314 | should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567' |
|
317 | 315 | should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567' |
|
318 | 316 | |
|
319 | 317 | should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567' |
|
320 | 318 | |
|
321 | 319 | should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567' |
|
322 | 320 | |
|
323 | 321 | should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567' |
|
324 | 322 | end |
|
325 | 323 | |
|
326 | 324 | context "timelogs (scoped under issues)" do |
|
327 | 325 | should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234' |
|
328 | 326 | should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv' |
|
329 | 327 | should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom' |
|
330 | 328 | should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234' |
|
331 | 329 | should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234' |
|
332 | 330 | |
|
333 | 331 | should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234' |
|
334 | 332 | |
|
335 | 333 | should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234' |
|
336 | 334 | |
|
337 | 335 | should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234' |
|
338 | 336 | end |
|
339 | 337 | |
|
340 | 338 | context "timelogs (scoped under project and issues)" do |
|
341 | 339 | should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook' |
|
342 | 340 | should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' |
|
343 | 341 | should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' |
|
344 | 342 | should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook' |
|
345 | 343 | should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook' |
|
346 | 344 | |
|
347 | 345 | should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook' |
|
348 | 346 | |
|
349 | 347 | should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook' |
|
350 | 348 | |
|
351 | 349 | should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook' |
|
352 | 350 | |
|
353 | 351 | should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report' |
|
354 | 352 | should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567' |
|
355 | 353 | should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv' |
|
356 | 354 | end |
|
357 | 355 | |
|
358 | 356 | context "users" do |
|
359 | 357 | should_route :get, "/users", :controller => 'users', :action => 'index' |
|
360 | 358 | should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml' |
|
361 | 359 | should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' |
|
362 | 360 | should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml' |
|
363 | 361 | should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current' |
|
364 | 362 | should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml' |
|
365 | 363 | should_route :get, "/users/new", :controller => 'users', :action => 'new' |
|
366 | 364 | should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' |
|
367 | 365 | |
|
368 | 366 | should_route :post, "/users", :controller => 'users', :action => 'create' |
|
369 | 367 | should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml' |
|
370 | 368 | |
|
371 | 369 | should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444' |
|
372 | 370 | should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml' |
|
373 | 371 | |
|
374 | 372 | should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44' |
|
375 | 373 | should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml' |
|
376 | 374 | |
|
377 | 375 | should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123' |
|
378 | 376 | should_route :put, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' |
|
379 | 377 | should_route :delete, "/users/123/memberships/55", :controller => 'users', :action => 'destroy_membership', :id => '123', :membership_id => '55' |
|
380 | 378 | end |
|
381 | 379 | |
|
382 | 380 | context "versions" do |
|
383 | 381 | # /projects/foo/versions is /projects/foo/roadmap |
|
384 | 382 | should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml' |
|
385 | 383 | should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json' |
|
386 | 384 | |
|
387 | 385 | should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo' |
|
388 | 386 | |
|
389 | 387 | should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo' |
|
390 | 388 | should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml' |
|
391 | 389 | should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json' |
|
392 | 390 | |
|
393 | 391 | should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1' |
|
394 | 392 | should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml' |
|
395 | 393 | should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json' |
|
396 | 394 | |
|
397 | 395 | should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1' |
|
398 | 396 | |
|
399 | 397 | should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1' |
|
400 | 398 | should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml' |
|
401 | 399 | should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json' |
|
402 | 400 | |
|
403 | 401 | should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1' |
|
404 | 402 | should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml' |
|
405 | 403 | should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json' |
|
406 | 404 | |
|
407 | 405 | should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo' |
|
408 | 406 | should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1' |
|
409 | 407 | end |
|
410 | 408 | |
|
411 | 409 | context "wiki (singular, project's pages)" do |
|
412 | 410 | should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567' |
|
413 | 411 | should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala' |
|
414 | 412 | should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page' |
|
415 | 413 | should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation' |
|
416 | 414 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation' |
|
417 | 415 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2' |
|
418 | 416 | 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' |
|
419 | 417 | should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2' |
|
420 | 418 | should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' |
|
421 | 419 | should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567' |
|
422 | 420 | should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567' |
|
423 | 421 | should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567' |
|
424 | 422 | |
|
425 | 423 | should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation' |
|
426 | 424 | should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' |
|
427 | 425 | should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida' |
|
428 | 426 | should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida' |
|
429 | 427 | |
|
430 | 428 | should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page' |
|
431 | 429 | |
|
432 | 430 | should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida' |
|
433 | 431 | end |
|
434 | 432 | |
|
435 | 433 | context "wikis (plural, admin setup)" do |
|
436 | 434 | should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' |
|
437 | 435 | |
|
438 | 436 | should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida' |
|
439 | 437 | should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' |
|
440 | 438 | end |
|
441 | 439 | |
|
442 | 440 | context "administration panel" do |
|
443 | 441 | should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects' |
|
444 | 442 | end |
|
445 | 443 | end |
General Comments 0
You need to be logged in to leave comments.
Login now