##// END OF EJS Templates
Routes cleanup....
Jean-Philippe Lang -
r7899:1cb7de5b5a73
parent child
Show More
@@ -1,241 +1,239
1 1 ActionController::Routing::Routes.draw do |map|
2 2 # Add your own custom routes here.
3 3 # The priority is based upon order of creation: first created -> highest priority.
4 4
5 5 # Here's a sample route:
6 6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
7 7 # Keep in mind you can assign values other than :controller and :action
8 8
9 9 map.home '', :controller => 'welcome'
10 10
11 11 map.signin 'login', :controller => 'account', :action => 'login'
12 12 map.signout 'logout', :controller => 'account', :action => 'logout'
13 13
14 14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
15 15 map.connect 'help/:ctrl/:page', :controller => 'help'
16 16
17 17 map.with_options :controller => 'time_entry_reports', :action => 'report',:conditions => {:method => :get} do |time_report|
18 18 time_report.connect 'projects/:project_id/issues/:issue_id/time_entries/report'
19 19 time_report.connect 'projects/:project_id/issues/:issue_id/time_entries/report.:format'
20 20 time_report.connect 'projects/:project_id/time_entries/report'
21 21 time_report.connect 'projects/:project_id/time_entries/report.:format'
22 22 time_report.connect 'time_entries/report'
23 23 time_report.connect 'time_entries/report.:format'
24 24 end
25 25
26 26 map.bulk_edit_time_entry 'time_entries/bulk_edit',
27 27 :controller => 'timelog', :action => 'bulk_edit', :conditions => { :method => :get }
28 28 map.bulk_update_time_entry 'time_entries/bulk_edit',
29 29 :controller => 'timelog', :action => 'bulk_update', :conditions => { :method => :post }
30 30 map.time_entries_context_menu '/time_entries/context_menu',
31 31 :controller => 'context_menus', :action => 'time_entries'
32 # TODO: wasteful since this is also nested under issues, projects, and projects/issues
32
33 33 map.resources :time_entries, :controller => 'timelog'
34 34
35 35 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
36 36 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
37 37 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}
38 38
39 39 map.with_options :controller => 'messages' do |messages_routes|
40 40 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
41 41 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
42 42 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
43 43 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
44 44 end
45 45 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
46 46 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
47 47 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
48 48 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
49 49 end
50 50 end
51 51
52 52 map.with_options :controller => 'boards' do |board_routes|
53 53 board_routes.with_options :conditions => {:method => :get} do |board_views|
54 54 board_views.connect 'projects/:project_id/boards', :action => 'index'
55 55 board_views.connect 'projects/:project_id/boards/new', :action => 'new'
56 56 board_views.connect 'projects/:project_id/boards/:id', :action => 'show'
57 57 board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show'
58 58 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit'
59 59 end
60 60 board_routes.with_options :conditions => {:method => :post} do |board_actions|
61 61 board_actions.connect 'projects/:project_id/boards', :action => 'new'
62 62 board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/
63 63 end
64 64 end
65 65
66 66 map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move'
67 67 map.resources :queries, :except => [:show]
68 68
69 69 # Misc issue routes. TODO: move into resources
70 70 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues'
71 71 map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview
72 72 map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues'
73 73 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
74 74 map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get }
75 75 map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post }
76 76 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post }
77 77 map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy
78 78
79 79 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
80 80 gantts_routes.connect '/projects/:project_id/issues/gantt'
81 81 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
82 82 gantts_routes.connect '/issues/gantt.:format'
83 83 end
84 84
85 85 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
86 86 calendars_routes.connect '/projects/:project_id/issues/calendar'
87 87 calendars_routes.connect '/issues/calendar'
88 88 end
89 89
90 90 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
91 91 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
92 92 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
93 93 end
94 94
95 map.resources :issues, :member => { :edit => :post }, :collection => {} do |issues|
95 map.resources :issues do |issues|
96 96 issues.resources :time_entries, :controller => 'timelog'
97 97 issues.resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
98 98 end
99 99
100 map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post } do |issues|
101 issues.resources :time_entries, :controller => 'timelog'
102 end
103
104 100 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
105 101
106 102 map.with_options :controller => 'users' do |users|
107 103 users.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil, :conditions => {:method => :get}
108 104
109 105 users.with_options :conditions => {:method => :post} do |user_actions|
110 106 user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
111 107 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
112 108 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
113 109 end
114 110 end
115 111
116 112 map.resources :users, :member => {
117 113 :edit_membership => :post,
118 114 :destroy_membership => :post
119 115 }
120 116
121 117 # For nice "roadmap" in the url for the index action
122 118 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
123 119
124 120 map.all_news 'news', :controller => 'news', :action => 'index'
125 121 map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index'
126 122 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
127 123 map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post}
128 124 map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete}
129 125
130 126 map.resources :projects, :member => {
131 127 :copy => [:get, :post],
132 128 :settings => :get,
133 129 :modules => :post,
134 130 :archive => :post,
135 131 :unarchive => :post
136 132 } do |project|
137 133 project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy]
134 project.resources :issues, :only => [:index, :new, :create] do |issues|
135 issues.resources :time_entries, :controller => 'timelog'
136 end
138 137 project.resources :files, :only => [:index, :new, :create]
139 138 project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post}
140 139 project.resources :news, :shallow => true
141 140 project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id'
142 141 project.resources :queries, :only => [:new, :create]
143 142 project.resources :issue_categories, :shallow => true
144 143 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
145 144
146 145 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
147 146 project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
148 147 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
149 148 project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
150 149 project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
151 150 project.resources :wiki, :except => [:new, :create], :member => {
152 151 :rename => [:get, :post],
153 152 :history => :get,
154 153 :preview => :any,
155 154 :protect => :post,
156 155 :add_attachment => :post
157 156 }, :collection => {
158 157 :export => :get,
159 158 :date_index => :get
160 159 }
161 160
162 161 end
163 162
164 163 # Destroy uses a get request to prompt the user before the actual DELETE request
165 164 map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get}
166 165
167 166 # TODO: port to be part of the resources route(s)
168 167 map.with_options :controller => 'projects' do |project_mapper|
169 168 project_mapper.with_options :conditions => {:method => :get} do |project_views|
170 169 project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings'
171 170 project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new'
172 171 end
173 172 end
174 173
175 174 map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity|
176 175 activity.connect 'projects/:id/activity'
177 176 activity.connect 'projects/:id/activity.:format'
178 177 activity.connect 'activity', :id => nil
179 178 activity.connect 'activity.:format', :id => nil
180 179 end
181 180
182 181 map.with_options :controller => 'repositories' do |repositories|
183 182 repositories.with_options :conditions => {:method => :get} do |repository_views|
184 183 repository_views.connect 'projects/:id/repository', :action => 'show'
185 184 repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
186 185 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
187 186 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
188 187 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
189 188 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
190 189 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
191 190 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
192 191 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
193 192 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
194 193 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
195 194 # TODO: why the following route is required?
196 195 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
197 196 repository_views.connect 'projects/:id/repository/:action/*path'
198 197 end
199 198
200 199 repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post}
201 200 end
202 201
203 202 map.resources :attachments, :only => [:show, :destroy]
204 203 # additional routes for having the file name at the end of url
205 204 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
206 205 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
207 206
208 207 map.resources :groups, :member => {:autocomplete_for_user => :get}
209 208 map.group_users 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post}
210 209 map.group_user 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :conditions => {:method => :delete}
211 210
212 211 map.resources :trackers, :except => :show
213 212 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
214 213
215 214 #left old routes at the bottom for backwards compat
216 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
217 215 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
218 216 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
219 217 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki'
220 218 map.connect 'projects/:project_id/news/:action', :controller => 'news'
221 219 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
222 220 map.with_options :controller => 'repositories' do |omap|
223 221 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
224 222 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
225 223 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
226 224 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
227 225 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
228 226 omap.connect 'repositories/revision/:id/:rev', :action => 'revision'
229 227 end
230 228
231 229 map.with_options :controller => 'sys' do |sys|
232 230 sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get}
233 231 sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post}
234 232 end
235 233
236 234 # Install the default route as the lowest priority.
237 235 map.connect ':controller/:action/:id'
238 236 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
239 237 # Used for OpenID
240 238 map.root :controller => 'account', :action => 'login'
241 239 end
@@ -1,429 +1,427
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/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
43 43 should_route :post, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
44 44 should_route :post, "/projects/world_domination/boards/44/destroy", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44'
45 45
46 46 end
47 47
48 48 context "documents" do
49 49 should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
50 50 should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
51 51 should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
52 52 should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
53 53
54 54 should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567'
55 55 should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22'
56 56 should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22'
57 57
58 58 should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22'
59 59 end
60 60
61 61 context "groups" do
62 62 should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567'
63 63 should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12'
64 64 end
65 65
66 66 context "issues" do
67 67 # REST actions
68 68 should_route :get, "/issues", :controller => 'issues', :action => 'index'
69 69 should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf'
70 70 should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom'
71 71 should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml'
72 72 should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23'
73 73 should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf'
74 74 should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom'
75 75 should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml'
76 76 should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64'
77 77 should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf'
78 78 should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom'
79 79 should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml'
80 80
81 81 should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
82 82 should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
83 83 should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
84 84
85 85 should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
86 # TODO: Should use PUT
87 should_route :post, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
88 86 should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
89 87
90 88 # TODO: Should use DELETE
91 89 should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64'
92 90 should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
93 91
94 92 # Extra actions
95 93 should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'
96 94
97 95 should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new'
98 96 should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create'
99 97
100 98 should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1'
101 99
102 100 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
103 101 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
104 102
105 103 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
106 104 should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf'
107 105 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
108 106 should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf'
109 107
110 108 should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues'
111 109
112 110 should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
113 111 should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
114 112 should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
115 113 should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
116 114
117 115 should_route :get, "/issues/changes", :controller => 'journals', :action => 'index'
118 116
119 117 should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit'
120 118 should_route :post, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_update'
121 119 end
122 120
123 121 context "issue categories" do
124 122 should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo'
125 123 should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml'
126 124 should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json'
127 125
128 126 should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo'
129 127
130 128 should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo'
131 129 should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml'
132 130 should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json'
133 131
134 132 should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1'
135 133 should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml'
136 134 should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json'
137 135
138 136 should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1'
139 137
140 138 should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1'
141 139 should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml'
142 140 should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json'
143 141
144 142 should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1'
145 143 should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml'
146 144 should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json'
147 145 end
148 146
149 147 context "issue relations" do
150 148 should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1'
151 149 should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml'
152 150 should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json'
153 151
154 152 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1'
155 153 should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml'
156 154 should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json'
157 155
158 156 should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23'
159 157 should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml'
160 158 should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json'
161 159
162 160 should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23'
163 161 should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml'
164 162 should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json'
165 163 end
166 164
167 165 context "issue reports" do
168 166 should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567'
169 167 should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to'
170 168 end
171 169
172 170 context "members" do
173 171 should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234'
174 172 end
175 173
176 174 context "messages" do
177 175 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
178 176 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
179 177 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
180 178
181 179 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
182 180 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
183 181 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
184 182 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
185 183 end
186 184
187 185 context "news" do
188 186 should_route :get, "/news", :controller => 'news', :action => 'index'
189 187 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
190 188 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
191 189 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
192 190 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
193 191 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
194 192 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
195 193 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
196 194 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
197 195 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
198 196 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
199 197 should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
200 198 should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
201 199
202 200 should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
203 201 should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
204 202
205 203 should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567'
206 204
207 205 should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567'
208 206 should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15'
209 207 end
210 208
211 209 context "projects" do
212 210 should_route :get, "/projects", :controller => 'projects', :action => 'index'
213 211 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
214 212 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
215 213 should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
216 214 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
217 215 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
218 216 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
219 217 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
220 218 should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33'
221 219 should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33'
222 220 should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
223 221 should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
224 222 should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
225 223
226 224 should_route :post, "/projects", :controller => 'projects', :action => 'create'
227 225 should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml'
228 226 should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33'
229 227 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
230 228 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
231 229
232 230 should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64'
233 231 should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223'
234 232 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml'
235 233
236 234 should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64'
237 235 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
238 236 should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64'
239 237 end
240 238
241 239 context "queries" do
242 240 should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml'
243 241 should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json'
244 242
245 243 should_route :get, "/queries/new", :controller => 'queries', :action => 'new'
246 244 should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine'
247 245
248 246 should_route :post, "/queries", :controller => 'queries', :action => 'create'
249 247 should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine'
250 248
251 249 should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1'
252 250
253 251 should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1'
254 252
255 253 should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1'
256 254 end
257 255
258 256 context "repositories" do
259 257 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
260 258 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
261 259 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
262 260 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
263 261 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
264 262 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
265 263 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
266 264 should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c]
267 265 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'
268 266 should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c]
269 267 should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c]
270 268 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'
271 269 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'
272 270 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'
273 271 should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c]
274 272 should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c]
275 273 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
276 274
277 275 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
278 276 end
279 277
280 278 context "timelogs (global)" do
281 279 should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
282 280 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
283 281 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
284 282 should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
285 283 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
286 284
287 285 should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
288 286
289 287 should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
290 288
291 289 should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
292 290 end
293 291
294 292 context "timelogs (scoped under project)" do
295 293 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
296 294 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
297 295 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
298 296 should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
299 297 should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
300 298
301 299 should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
302 300
303 301 should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
304 302
305 303 should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
306 304 end
307 305
308 306 context "timelogs (scoped under issues)" do
309 307 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234'
310 308 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv'
311 309 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom'
312 310 should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234'
313 311 should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234'
314 312
315 313 should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234'
316 314
317 315 should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234'
318 316
319 317 should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234'
320 318 end
321 319
322 320 context "timelogs (scoped under project and issues)" do
323 321 should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
324 322 should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
325 323 should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
326 324 should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
327 325 should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
328 326
329 327 should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
330 328
331 329 should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
332 330
333 331 should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
334 332 end
335 333
336 334 context "time_entry_reports" do
337 335 should_route :get, "/time_entries/report", :controller => 'time_entry_reports', :action => 'report'
338 336 should_route :get, "/projects/567/time_entries/report", :controller => 'time_entry_reports', :action => 'report', :project_id => '567'
339 337 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'time_entry_reports', :action => 'report', :project_id => '567', :format => 'csv'
340 338 end
341 339
342 340 context "users" do
343 341 should_route :get, "/users", :controller => 'users', :action => 'index'
344 342 should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml'
345 343 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
346 344 should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml'
347 345 should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current'
348 346 should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml'
349 347 should_route :get, "/users/new", :controller => 'users', :action => 'new'
350 348 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
351 349 should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'
352 350
353 351 should_route :post, "/users", :controller => 'users', :action => 'create'
354 352 should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml'
355 353 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
356 354 should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
357 355 should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
358 356
359 357 should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
360 358 should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml'
361 359
362 360 should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44'
363 361 should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml'
364 362 end
365 363
366 364 context "versions" do
367 365 # /projects/foo/versions is /projects/foo/roadmap
368 366 should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml'
369 367 should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json'
370 368
371 369 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
372 370
373 371 should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo'
374 372 should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml'
375 373 should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json'
376 374
377 375 should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1'
378 376 should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml'
379 377 should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json'
380 378
381 379 should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1'
382 380
383 381 should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1'
384 382 should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml'
385 383 should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json'
386 384
387 385 should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1'
388 386 should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml'
389 387 should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json'
390 388
391 389 should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo'
392 390 should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1'
393 391 end
394 392
395 393 context "wiki (singular, project's pages)" do
396 394 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
397 395 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala'
398 396 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page'
399 397 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation'
400 398 should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation'
401 399 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
402 400 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'
403 401 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
404 402 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
405 403 should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
406 404 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
407 405 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
408 406
409 407 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation'
410 408 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
411 409 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida'
412 410 should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida'
413 411
414 412 should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page'
415 413
416 414 should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida'
417 415 end
418 416
419 417 context "wikis (plural, admin setup)" do
420 418 should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
421 419
422 420 should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida'
423 421 should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
424 422 end
425 423
426 424 context "administration panel" do
427 425 should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects'
428 426 end
429 427 end
General Comments 0
You need to be logged in to leave comments. Login now