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