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