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@0
|
18 require "#{File.dirname(__FILE__)}/../test_helper"
|
Chris@0
|
19
|
Chris@0
|
20 class RoutingTest < ActionController::IntegrationTest
|
Chris@0
|
21 context "activities" do
|
Chris@0
|
22 should_route :get, "/activity", :controller => 'projects', :action => 'activity', :id => nil
|
Chris@0
|
23 should_route :get, "/activity.atom", :controller => 'projects', :action => 'activity', :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@0
|
88 should_route :get, "/issues/1/move", :controller => 'issues', :action => 'move', :id => '1'
|
Chris@0
|
89 should_route :post, "/issues/1/move", :controller => 'issues', :action => 'move', :id => '1'
|
Chris@0
|
90
|
Chris@0
|
91 should_route :post, "/issues/1/quoted", :controller => 'issues', :action => 'reply', :id => '1'
|
Chris@0
|
92
|
Chris@0
|
93 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
|
Chris@0
|
94 should_route :post, "/issues/calendar", :controller => 'calendars', :action => 'show'
|
Chris@0
|
95 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
|
Chris@0
|
96 should_route :post, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
|
Chris@0
|
97
|
Chris@0
|
98 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
|
Chris@0
|
99 should_route :post, "/issues/gantt", :controller => 'gantts', :action => 'show'
|
Chris@0
|
100 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
|
Chris@0
|
101 should_route :post, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
|
Chris@0
|
102
|
Chris@0
|
103 should_route :get, "/issues/auto_complete", :controller => 'issues', :action => 'auto_complete'
|
Chris@0
|
104 end
|
Chris@0
|
105
|
Chris@0
|
106 context "issue categories" do
|
Chris@0
|
107 should_route :get, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test'
|
Chris@0
|
108
|
Chris@0
|
109 should_route :post, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test'
|
Chris@0
|
110 end
|
Chris@0
|
111
|
Chris@0
|
112 context "issue relations" do
|
Chris@0
|
113 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'new', :issue_id => '1'
|
Chris@0
|
114 should_route :post, "/issues/1/relations/23/destroy", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23'
|
Chris@0
|
115 end
|
Chris@0
|
116
|
Chris@0
|
117 context "issue reports" do
|
Chris@0
|
118 should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567'
|
Chris@0
|
119 should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to'
|
Chris@0
|
120 end
|
Chris@0
|
121
|
Chris@0
|
122 context "members" do
|
Chris@0
|
123 should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234'
|
Chris@0
|
124 end
|
Chris@0
|
125
|
Chris@0
|
126 context "messages" do
|
Chris@0
|
127 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
|
Chris@0
|
128 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
|
Chris@0
|
129 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
|
Chris@0
|
130
|
Chris@0
|
131 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
|
Chris@0
|
132 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
|
Chris@0
|
133 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
|
Chris@0
|
134 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
|
Chris@0
|
135 end
|
Chris@0
|
136
|
Chris@0
|
137 context "news" do
|
Chris@0
|
138 should_route :get, "/news", :controller => 'news', :action => 'index'
|
Chris@0
|
139 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
|
Chris@0
|
140 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
|
Chris@0
|
141 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
|
Chris@0
|
142 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
|
Chris@0
|
143 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
|
Chris@0
|
144 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
|
Chris@0
|
145 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
|
Chris@0
|
146 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
|
Chris@0
|
147 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
|
Chris@0
|
148 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
|
Chris@0
|
149
|
Chris@0
|
150 should_route :post, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
|
Chris@0
|
151 should_route :post, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
|
Chris@0
|
152 should_route :post, "/news/567/destroy", :controller => 'news', :action => 'destroy', :id => '567'
|
Chris@0
|
153 end
|
Chris@0
|
154
|
Chris@0
|
155 context "projects" do
|
Chris@0
|
156 should_route :get, "/projects", :controller => 'projects', :action => 'index'
|
Chris@0
|
157 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
|
Chris@0
|
158 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
|
Chris@0
|
159 should_route :get, "/projects/new", :controller => 'projects', :action => 'add'
|
Chris@0
|
160 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
|
Chris@0
|
161 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
|
Chris@0
|
162 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
|
Chris@0
|
163 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
|
Chris@0
|
164 should_route :get, "/projects/567/destroy", :controller => 'projects', :action => 'destroy', :id => '567'
|
Chris@0
|
165 should_route :get, "/projects/33/files", :controller => 'projects', :action => 'list_files', :id => '33'
|
Chris@0
|
166 should_route :get, "/projects/33/files/new", :controller => 'projects', :action => 'add_file', :id => '33'
|
Chris@0
|
167 should_route :get, "/projects/33/roadmap", :controller => 'projects', :action => 'roadmap', :id => '33'
|
Chris@0
|
168 should_route :get, "/projects/33/activity", :controller => 'projects', :action => 'activity', :id => '33'
|
Chris@0
|
169 should_route :get, "/projects/33/activity.atom", :controller => 'projects', :action => 'activity', :id => '33', :format => 'atom'
|
Chris@0
|
170
|
Chris@0
|
171 should_route :post, "/projects/new", :controller => 'projects', :action => 'add'
|
Chris@0
|
172 should_route :post, "/projects.xml", :controller => 'projects', :action => 'add', :format => 'xml'
|
Chris@0
|
173 should_route :post, "/projects/4223/edit", :controller => 'projects', :action => 'edit', :id => '4223'
|
Chris@0
|
174 should_route :post, "/projects/64/destroy", :controller => 'projects', :action => 'destroy', :id => '64'
|
Chris@0
|
175 should_route :post, "/projects/33/files/new", :controller => 'projects', :action => 'add_file', :id => '33'
|
Chris@0
|
176 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
|
Chris@0
|
177 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
|
Chris@0
|
178 should_route :post, "/projects/64/activities/save", :controller => 'projects', :action => 'save_activities', :id => '64'
|
Chris@0
|
179
|
Chris@0
|
180 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'edit', :id => '1', :format => 'xml'
|
Chris@0
|
181
|
Chris@0
|
182 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
|
Chris@0
|
183 should_route :delete, "/projects/64/reset_activities", :controller => 'projects', :action => 'reset_activities', :id => '64'
|
Chris@0
|
184 end
|
Chris@0
|
185
|
Chris@0
|
186 context "repositories" do
|
Chris@0
|
187 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
|
Chris@0
|
188 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
|
Chris@0
|
189 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
|
Chris@0
|
190 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
|
Chris@0
|
191 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
|
Chris@0
|
192 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
|
Chris@0
|
193 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
|
Chris@0
|
194 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
|
195 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
|
196 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
|
197 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
|
198 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
|
199 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
|
200 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
|
201 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
|
202 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
|
203 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
|
Chris@0
|
204
|
Chris@0
|
205
|
Chris@0
|
206 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
|
Chris@0
|
207 end
|
Chris@0
|
208
|
Chris@0
|
209 context "timelogs" do
|
Chris@0
|
210 should_route :get, "/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :issue_id => '567'
|
Chris@0
|
211 should_route :get, "/projects/ecookbook/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook'
|
Chris@0
|
212 should_route :get, "/projects/ecookbook/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook', :issue_id => '567'
|
Chris@0
|
213 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
|
Chris@0
|
214 should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
|
Chris@0
|
215 should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
|
Chris@0
|
216 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
|
Chris@0
|
217 should_route :get, "/time_entries", :controller => 'timelog', :action => 'details'
|
Chris@0
|
218 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'details', :format => 'csv'
|
Chris@0
|
219 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'details', :format => 'atom'
|
Chris@0
|
220 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'details', :project_id => '567'
|
Chris@0
|
221 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'csv'
|
Chris@0
|
222 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'atom'
|
Chris@0
|
223 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'details', :issue_id => '234'
|
Chris@0
|
224 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'csv'
|
Chris@0
|
225 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'atom'
|
Chris@0
|
226 should_route :get, "/projects/ecookbook/issues/123/time_entries", :controller => 'timelog', :action => 'details', :project_id => 'ecookbook', :issue_id => '123'
|
Chris@0
|
227
|
Chris@0
|
228 should_route :post, "/time_entries/55/destroy", :controller => 'timelog', :action => 'destroy', :id => '55'
|
Chris@0
|
229 end
|
Chris@0
|
230
|
Chris@0
|
231 context "users" do
|
Chris@0
|
232 should_route :get, "/users", :controller => 'users', :action => 'index'
|
Chris@0
|
233 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
|
Chris@0
|
234 should_route :get, "/users/new", :controller => 'users', :action => 'add'
|
Chris@0
|
235 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
|
Chris@0
|
236 should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'
|
Chris@0
|
237
|
Chris@0
|
238 should_route :post, "/users/new", :controller => 'users', :action => 'add'
|
Chris@0
|
239 should_route :post, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
|
Chris@0
|
240 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
|
Chris@0
|
241 should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
|
Chris@0
|
242 should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
|
Chris@0
|
243 end
|
Chris@0
|
244
|
Chris@0
|
245 context "versions" do
|
Chris@0
|
246 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
|
Chris@0
|
247
|
Chris@0
|
248 should_route :post, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
|
Chris@0
|
249 end
|
Chris@0
|
250
|
Chris@0
|
251 context "wiki (singular, project's pages)" do
|
Chris@0
|
252 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'index', :id => '567'
|
Chris@0
|
253 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'index', :id => '567', :page => 'lalala'
|
Chris@0
|
254 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
|
Chris@0
|
255 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :id => '1', :page => 'CookBook_documentation'
|
Chris@0
|
256 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :id => '1', :page => 'CookBook_documentation', :version => '2', :version_from => '1'
|
Chris@0
|
257 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :id => '1', :page => 'CookBook_documentation', :version => '2'
|
Chris@0
|
258 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
|
Chris@0
|
259 should_route :get, "/projects/567/wiki/page_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'page_index'
|
Chris@0
|
260 should_route :get, "/projects/567/wiki/Page_Index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'Page_Index'
|
Chris@0
|
261 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'date_index'
|
Chris@0
|
262 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'special', :id => '567', :page => 'export'
|
Chris@0
|
263
|
Chris@0
|
264 should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
|
Chris@0
|
265 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :id => '567', :page => 'CookBook_documentation'
|
Chris@0
|
266 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
|
Chris@0
|
267 should_route :post, "/projects/22/wiki/ladida/destroy", :controller => 'wiki', :action => 'destroy', :id => '22', :page => 'ladida'
|
Chris@0
|
268 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :id => '22', :page => 'ladida'
|
Chris@0
|
269 end
|
Chris@0
|
270
|
Chris@0
|
271 context "wikis (plural, admin setup)" do
|
Chris@0
|
272 should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
|
Chris@0
|
273
|
Chris@0
|
274 should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida'
|
Chris@0
|
275 should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
|
Chris@0
|
276 end
|
Chris@0
|
277
|
Chris@0
|
278 context "administration panel" do
|
Chris@0
|
279 should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects'
|
Chris@0
|
280 end
|
Chris@0
|
281 end
|