Chris@0
|
1 # redMine - project management software
|
Chris@0
|
2 # Copyright (C) 2006-2010 Jean-Philippe Lang
|
Chris@0
|
3 #
|
Chris@0
|
4 # This program is free software; you can redistribute it and/or
|
Chris@0
|
5 # modify it under the terms of the GNU General Public License
|
Chris@0
|
6 # as published by the Free Software Foundation; either version 2
|
Chris@0
|
7 # of the License, or (at your option) any later version.
|
Chris@0
|
8 #
|
Chris@0
|
9 # This program is distributed in the hope that it will be useful,
|
Chris@0
|
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Chris@0
|
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Chris@0
|
12 # GNU General Public License for more details.
|
Chris@0
|
13 #
|
Chris@0
|
14 # You should have received a copy of the GNU General Public License
|
Chris@0
|
15 # along with this program; if not, write to the Free Software
|
Chris@0
|
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Chris@0
|
17
|
Chris@119
|
18 require File.expand_path('../../test_helper', __FILE__)
|
Chris@0
|
19
|
Chris@0
|
20 class RoutingTest < ActionController::IntegrationTest
|
Chris@0
|
21 context "activities" do
|
chris@22
|
22 should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil
|
chris@22
|
23 should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom'
|
Chris@0
|
24 end
|
Chris@0
|
25
|
Chris@0
|
26 context "attachments" do
|
Chris@0
|
27 should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1'
|
Chris@0
|
28 should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext'
|
Chris@0
|
29 should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1'
|
Chris@0
|
30 should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext'
|
Chris@0
|
31 end
|
Chris@0
|
32
|
Chris@0
|
33 context "boards" do
|
Chris@0
|
34 should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination'
|
Chris@0
|
35 should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
|
Chris@0
|
36 should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44'
|
Chris@0
|
37 should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom'
|
Chris@0
|
38 should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
|
Chris@0
|
39
|
Chris@0
|
40 should_route :post, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
|
Chris@0
|
41 should_route :post, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
|
Chris@0
|
42 should_route :post, "/projects/world_domination/boards/44/destroy", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44'
|
Chris@0
|
43
|
Chris@0
|
44 end
|
Chris@0
|
45
|
Chris@0
|
46 context "documents" do
|
Chris@0
|
47 should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
|
Chris@0
|
48 should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
|
Chris@0
|
49 should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
|
Chris@0
|
50 should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
|
Chris@0
|
51
|
Chris@0
|
52 should_route :post, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
|
Chris@0
|
53 should_route :post, "/documents/567/edit", :controller => 'documents', :action => 'edit', :id => '567'
|
Chris@0
|
54 should_route :post, "/documents/567/destroy", :controller => 'documents', :action => 'destroy', :id => '567'
|
Chris@0
|
55 end
|
Chris@0
|
56
|
Chris@0
|
57 context "issues" do
|
Chris@0
|
58 # REST actions
|
Chris@0
|
59 should_route :get, "/issues", :controller => 'issues', :action => 'index'
|
Chris@0
|
60 should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf'
|
Chris@0
|
61 should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom'
|
Chris@0
|
62 should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml'
|
Chris@0
|
63 should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23'
|
Chris@0
|
64 should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf'
|
Chris@0
|
65 should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom'
|
Chris@0
|
66 should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml'
|
Chris@0
|
67 should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64'
|
Chris@0
|
68 should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf'
|
Chris@0
|
69 should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom'
|
Chris@0
|
70 should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml'
|
Chris@0
|
71
|
Chris@0
|
72 should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
|
Chris@0
|
73 should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
|
Chris@0
|
74 should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
|
Chris@0
|
75
|
Chris@0
|
76 should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
|
Chris@0
|
77 # TODO: Should use PUT
|
Chris@0
|
78 should_route :post, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
|
Chris@0
|
79 should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
|
Chris@0
|
80
|
Chris@0
|
81 # TODO: Should use DELETE
|
Chris@0
|
82 should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64'
|
Chris@0
|
83 should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
|
Chris@0
|
84
|
Chris@0
|
85 # Extra actions
|
Chris@0
|
86 should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'
|
Chris@0
|
87
|
Chris@14
|
88 should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new'
|
Chris@14
|
89 should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create'
|
Chris@0
|
90
|
Chris@14
|
91 should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1'
|
Chris@0
|
92
|
Chris@0
|
93 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
|
Chris@0
|
94 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
|
Chris@0
|
95
|
Chris@0
|
96 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
|
Chris@441
|
97 should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf'
|
Chris@0
|
98 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
|
Chris@441
|
99 should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf'
|
Chris@0
|
100
|
Chris@14
|
101 should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues'
|
Chris@14
|
102
|
Chris@14
|
103 should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
|
Chris@14
|
104 should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
|
Chris@14
|
105 should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
|
Chris@14
|
106 should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
|
Chris@14
|
107
|
Chris@14
|
108 should_route :get, "/issues/changes", :controller => 'journals', :action => 'index'
|
Chris@14
|
109
|
Chris@14
|
110 should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit'
|
Chris@14
|
111 should_route :post, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_update'
|
Chris@0
|
112 end
|
Chris@0
|
113
|
Chris@0
|
114 context "issue categories" do
|
Chris@0
|
115 should_route :get, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test'
|
Chris@0
|
116
|
Chris@0
|
117 should_route :post, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test'
|
Chris@0
|
118 end
|
Chris@0
|
119
|
Chris@0
|
120 context "issue relations" do
|
Chris@0
|
121 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'new', :issue_id => '1'
|
Chris@0
|
122 should_route :post, "/issues/1/relations/23/destroy", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23'
|
Chris@0
|
123 end
|
Chris@0
|
124
|
Chris@0
|
125 context "issue reports" do
|
Chris@0
|
126 should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567'
|
Chris@0
|
127 should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to'
|
Chris@0
|
128 end
|
Chris@0
|
129
|
Chris@0
|
130 context "members" do
|
Chris@0
|
131 should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234'
|
Chris@0
|
132 end
|
Chris@0
|
133
|
Chris@0
|
134 context "messages" do
|
Chris@0
|
135 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
|
Chris@0
|
136 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
|
Chris@0
|
137 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
|
Chris@0
|
138
|
Chris@0
|
139 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
|
Chris@0
|
140 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
|
Chris@0
|
141 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
|
Chris@0
|
142 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
|
Chris@0
|
143 end
|
Chris@0
|
144
|
Chris@0
|
145 context "news" do
|
Chris@0
|
146 should_route :get, "/news", :controller => 'news', :action => 'index'
|
Chris@0
|
147 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
|
Chris@0
|
148 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
|
Chris@0
|
149 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
|
Chris@0
|
150 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
|
Chris@0
|
151 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
|
Chris@0
|
152 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
|
Chris@0
|
153 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
|
Chris@0
|
154 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
|
Chris@0
|
155 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
|
Chris@0
|
156 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
|
chris@22
|
157 should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
|
chris@37
|
158 should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
|
chris@37
|
159
|
chris@37
|
160 should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
|
chris@37
|
161 should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
|
Chris@0
|
162
|
chris@37
|
163 should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567'
|
chris@22
|
164
|
chris@37
|
165 should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567'
|
chris@22
|
166 should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15'
|
Chris@0
|
167 end
|
Chris@0
|
168
|
Chris@0
|
169 context "projects" do
|
Chris@0
|
170 should_route :get, "/projects", :controller => 'projects', :action => 'index'
|
Chris@0
|
171 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
|
Chris@0
|
172 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
|
chris@22
|
173 should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
|
Chris@0
|
174 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
|
Chris@0
|
175 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
|
Chris@0
|
176 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
|
Chris@0
|
177 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
|
chris@22
|
178 should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33'
|
chris@22
|
179 should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33'
|
chris@22
|
180 should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
|
chris@22
|
181 should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
|
chris@22
|
182 should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
|
Chris@0
|
183
|
chris@22
|
184 should_route :post, "/projects", :controller => 'projects', :action => 'create'
|
chris@22
|
185 should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml'
|
chris@22
|
186 should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33'
|
Chris@0
|
187 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
|
Chris@0
|
188 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
|
Chris@0
|
189
|
chris@22
|
190 should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64'
|
chris@22
|
191 should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223'
|
chris@22
|
192 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml'
|
Chris@0
|
193
|
chris@22
|
194 should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64'
|
Chris@0
|
195 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
|
chris@22
|
196 should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64'
|
Chris@0
|
197 end
|
Chris@441
|
198
|
Chris@441
|
199 context "queries" do
|
Chris@441
|
200 should_route :get, "/queries/new", :controller => 'queries', :action => 'new'
|
Chris@441
|
201 should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine'
|
Chris@441
|
202
|
Chris@441
|
203 should_route :post, "/queries/new", :controller => 'queries', :action => 'new'
|
Chris@441
|
204 should_route :post, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine'
|
Chris@441
|
205 end
|
Chris@0
|
206
|
Chris@0
|
207 context "repositories" do
|
Chris@0
|
208 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
|
Chris@0
|
209 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
|
Chris@0
|
210 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
|
Chris@0
|
211 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
|
Chris@0
|
212 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
|
Chris@0
|
213 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
|
Chris@0
|
214 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
|
Chris@0
|
215 should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c]
|
Chris@0
|
216 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'
|
Chris@0
|
217 should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c]
|
Chris@0
|
218 should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c]
|
Chris@0
|
219 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'
|
Chris@0
|
220 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'
|
Chris@0
|
221 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'
|
Chris@0
|
222 should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c]
|
Chris@0
|
223 should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c]
|
Chris@0
|
224 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
|
Chris@0
|
225
|
Chris@0
|
226
|
Chris@0
|
227 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
|
Chris@0
|
228 end
|
Chris@0
|
229
|
chris@37
|
230 context "timelogs (global)" do
|
chris@37
|
231 should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
|
chris@37
|
232 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
|
chris@37
|
233 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
|
chris@37
|
234 should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
|
Chris@0
|
235 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
|
Chris@0
|
236
|
chris@37
|
237 should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
|
chris@37
|
238
|
chris@37
|
239 should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
|
chris@37
|
240
|
chris@37
|
241 should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
|
chris@37
|
242 end
|
chris@37
|
243
|
chris@37
|
244 context "timelogs (scoped under project)" do
|
chris@37
|
245 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
|
chris@37
|
246 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
|
chris@37
|
247 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
|
chris@37
|
248 should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
|
chris@37
|
249 should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
|
chris@37
|
250
|
chris@37
|
251 should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
|
chris@37
|
252
|
chris@37
|
253 should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
|
chris@37
|
254
|
chris@37
|
255 should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
|
chris@37
|
256 end
|
chris@37
|
257
|
chris@37
|
258 context "timelogs (scoped under issues)" do
|
chris@37
|
259 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234'
|
chris@37
|
260 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv'
|
chris@37
|
261 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom'
|
chris@37
|
262 should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234'
|
chris@37
|
263 should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234'
|
chris@37
|
264
|
chris@37
|
265 should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234'
|
chris@37
|
266
|
chris@37
|
267 should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234'
|
chris@37
|
268
|
chris@37
|
269 should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234'
|
chris@37
|
270 end
|
chris@37
|
271
|
chris@37
|
272 context "timelogs (scoped under project and issues)" do
|
chris@37
|
273 should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
|
chris@37
|
274 should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
|
chris@37
|
275 should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
|
chris@37
|
276 should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
|
chris@37
|
277 should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
|
chris@37
|
278
|
chris@37
|
279 should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
|
chris@37
|
280
|
chris@37
|
281 should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
|
chris@37
|
282
|
chris@37
|
283 should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
|
chris@37
|
284 end
|
chris@37
|
285
|
chris@37
|
286 context "time_entry_reports" do
|
chris@37
|
287 should_route :get, "/time_entries/report", :controller => 'time_entry_reports', :action => 'report'
|
chris@37
|
288 should_route :get, "/projects/567/time_entries/report", :controller => 'time_entry_reports', :action => 'report', :project_id => '567'
|
chris@37
|
289 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'time_entry_reports', :action => 'report', :project_id => '567', :format => 'csv'
|
Chris@0
|
290 end
|
Chris@0
|
291
|
Chris@0
|
292 context "users" do
|
Chris@0
|
293 should_route :get, "/users", :controller => 'users', :action => 'index'
|
Chris@119
|
294 should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml'
|
Chris@0
|
295 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
|
Chris@119
|
296 should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml'
|
Chris@119
|
297 should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current'
|
Chris@119
|
298 should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml'
|
chris@37
|
299 should_route :get, "/users/new", :controller => 'users', :action => 'new'
|
Chris@0
|
300 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
|
Chris@0
|
301 should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'
|
Chris@0
|
302
|
chris@37
|
303 should_route :post, "/users", :controller => 'users', :action => 'create'
|
Chris@119
|
304 should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml'
|
Chris@0
|
305 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
|
Chris@0
|
306 should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
|
Chris@0
|
307 should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
|
chris@37
|
308
|
chris@37
|
309 should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
|
Chris@119
|
310 should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml'
|
Chris@128
|
311
|
Chris@128
|
312 should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44'
|
Chris@128
|
313 should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml'
|
Chris@0
|
314 end
|
Chris@0
|
315
|
chris@22
|
316 # TODO: should they all be scoped under /projects/:project_id ?
|
Chris@0
|
317 context "versions" do
|
Chris@0
|
318 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
|
chris@22
|
319 should_route :get, "/versions/show/1", :controller => 'versions', :action => 'show', :id => '1'
|
chris@22
|
320 should_route :get, "/versions/edit/1", :controller => 'versions', :action => 'edit', :id => '1'
|
Chris@0
|
321
|
chris@22
|
322 should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo'
|
chris@22
|
323 should_route :post, "/versions/update/1", :controller => 'versions', :action => 'update', :id => '1'
|
chris@22
|
324
|
chris@22
|
325 should_route :delete, "/versions/destroy/1", :controller => 'versions', :action => 'destroy', :id => '1'
|
Chris@0
|
326 end
|
Chris@0
|
327
|
Chris@0
|
328 context "wiki (singular, project's pages)" do
|
chris@37
|
329 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
|
chris@37
|
330 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala'
|
chris@37
|
331 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page'
|
chris@37
|
332 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation'
|
chris@37
|
333 should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation'
|
chris@37
|
334 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
|
chris@37
|
335 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'
|
chris@37
|
336 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
|
chris@37
|
337 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
|
chris@37
|
338 should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
|
chris@37
|
339 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
|
chris@37
|
340 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
|
Chris@0
|
341
|
chris@37
|
342 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation'
|
chris@37
|
343 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
|
chris@37
|
344 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida'
|
chris@37
|
345 should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida'
|
chris@37
|
346
|
chris@37
|
347 should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page'
|
chris@37
|
348
|
chris@37
|
349 should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida'
|
Chris@0
|
350 end
|
Chris@0
|
351
|
Chris@0
|
352 context "wikis (plural, admin setup)" do
|
Chris@0
|
353 should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
|
Chris@0
|
354
|
Chris@0
|
355 should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida'
|
Chris@0
|
356 should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
|
Chris@0
|
357 end
|
Chris@0
|
358
|
Chris@0
|
359 context "administration panel" do
|
Chris@0
|
360 should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects'
|
Chris@0
|
361 end
|
Chris@0
|
362 end
|