@@ -214,6 +214,9 RedmineApp::Application.routes.draw do | |||
|
214 | 214 | get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats' |
|
215 | 215 | get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph' |
|
216 | 216 | |
|
217 | get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', | |
|
218 | :to => 'repositories#changes' | |
|
219 | ||
|
217 | 220 | get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision' |
|
218 | 221 | get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision' |
|
219 | 222 | post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue' |
@@ -228,13 +231,16 RedmineApp::Application.routes.draw do | |||
|
228 | 231 | get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', |
|
229 | 232 | :controller => 'repositories', |
|
230 | 233 | :constraints => { |
|
231 |
:action => /(browse|show|entry| |
|
|
234 | :action => /(browse|show|entry|annotate|diff)/, | |
|
232 | 235 | :rev => /[a-z0-9\.\-_]+/ |
|
233 | 236 | } |
|
234 | 237 | |
|
235 | 238 | get 'projects/:id/repository/statistics', :to => 'repositories#stats' |
|
236 | 239 | get 'projects/:id/repository/graph', :to => 'repositories#graph' |
|
237 | 240 | |
|
241 | get 'projects/:id/repository/changes(/*path(.:ext))', | |
|
242 | :to => 'repositories#changes' | |
|
243 | ||
|
238 | 244 | get 'projects/:id/repository/revisions', :to => 'repositories#revisions' |
|
239 | 245 | get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' |
|
240 | 246 | get 'projects/:id/repository/revision', :to => 'repositories#revision' |
@@ -249,7 +255,7 RedmineApp::Application.routes.draw do | |||
|
249 | 255 | get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', |
|
250 | 256 | :controller => 'repositories', |
|
251 | 257 | :constraints => { |
|
252 |
:action => /(browse|show|entry| |
|
|
258 | :action => /(browse|show|entry|annotate|diff)/, | |
|
253 | 259 | :rev => /[a-z0-9\.\-_]+/ |
|
254 | 260 | } |
|
255 | 261 | get 'projects/:id/repository/:repository_id/:format(/*path(.:ext))', :to => 'repositories#entry', :format => /raw/ |
@@ -134,16 +134,29 class RoutingRepositoriesTest < ActionController::IntegrationTest | |||
|
134 | 134 | ) |
|
135 | 135 | assert_routing( |
|
136 | 136 | { :method => 'get', |
|
137 |
:path => "/projects/redmine/repository/ |
|
|
138 |
{ :controller => 'repositories', :action => 'changes', :id => 'redmine' |
|
|
139 | :rev => '2457' } | |
|
140 | ) | |
|
141 | assert_routing( | |
|
142 | { :method => 'get', | |
|
143 | :path => "/projects/redmine/repository/revisions/2457/changes/#{@path_hash[:path]}" }, | |
|
144 | { :controller => 'repositories', :action => 'changes', :id => 'redmine', | |
|
145 | :path => @path_hash[:param] , :rev => '2457'} | |
|
137 | :path => "/projects/redmine/repository/changes" }, | |
|
138 | { :controller => 'repositories', :action => 'changes', :id => 'redmine' } | |
|
146 | 139 | ) |
|
140 | ['2457', 'master', 'slash/slash'].each do |rev| | |
|
141 | assert_routing( | |
|
142 | { :method => 'get', | |
|
143 | :path => "/projects/redmine/repository/changes" }, | |
|
144 | { :controller => 'repositories', :action => 'changes', :id => 'redmine', | |
|
145 | :rev => rev }, | |
|
146 | {}, | |
|
147 | { :rev => rev } | |
|
148 | ) | |
|
149 | end | |
|
150 | ['2457', 'master', 'slash/slash'].each do |rev| | |
|
151 | assert_routing( | |
|
152 | { :method => 'get', | |
|
153 | :path => "/projects/redmine/repository/changes/#{@path_hash[:path]}" }, | |
|
154 | { :controller => 'repositories', :action => 'changes', :id => 'redmine', | |
|
155 | :path => @path_hash[:param], :rev => rev }, | |
|
156 | {}, | |
|
157 | { :rev => rev } | |
|
158 | ) | |
|
159 | end | |
|
147 | 160 | assert_routing( |
|
148 | 161 | { :method => 'get', |
|
149 | 162 | :path => "/projects/redmine/repository/revisions/2457/diff" }, |
@@ -215,16 +228,29 class RoutingRepositoriesTest < ActionController::IntegrationTest | |||
|
215 | 228 | ) |
|
216 | 229 | assert_routing( |
|
217 | 230 | { :method => 'get', |
|
218 |
:path => "/projects/redmine/repository/foo/ |
|
|
219 |
{ :controller => 'repositories', :action => 'changes', :id => 'redmine', :repository_id => 'foo' |
|
|
220 | :rev => '2457' } | |
|
221 | ) | |
|
222 | assert_routing( | |
|
223 | { :method => 'get', | |
|
224 | :path => "/projects/redmine/repository/foo/revisions/2457/changes/#{@path_hash[:path]}" }, | |
|
225 | { :controller => 'repositories', :action => 'changes', :id => 'redmine', :repository_id => 'foo', | |
|
226 | :path => @path_hash[:param] , :rev => '2457'} | |
|
231 | :path => "/projects/redmine/repository/foo/changes" }, | |
|
232 | { :controller => 'repositories', :action => 'changes', :id => 'redmine', :repository_id => 'foo' } | |
|
227 | 233 | ) |
|
234 | ['2457', 'master', 'slash/slash'].each do |rev| | |
|
235 | assert_routing( | |
|
236 | { :method => 'get', | |
|
237 | :path => "/projects/redmine/repository/foo/changes" }, | |
|
238 | { :controller => 'repositories', :action => 'changes', :id => 'redmine', | |
|
239 | :repository_id => 'foo', :rev => rev }, | |
|
240 | {}, | |
|
241 | { :rev => rev } | |
|
242 | ) | |
|
243 | end | |
|
244 | ['2457', 'master', 'slash/slash'].each do |rev| | |
|
245 | assert_routing( | |
|
246 | { :method => 'get', | |
|
247 | :path => "/projects/redmine/repository/foo/changes/#{@path_hash[:path]}" }, | |
|
248 | { :controller => 'repositories', :action => 'changes', :id => 'redmine', | |
|
249 | :repository_id => 'foo', :path => @path_hash[:param], :rev => rev }, | |
|
250 | {}, | |
|
251 | { :rev => rev } | |
|
252 | ) | |
|
253 | end | |
|
228 | 254 | assert_routing( |
|
229 | 255 | { :method => 'get', |
|
230 | 256 | :path => "/projects/redmine/repository/foo/revisions/2457/diff" }, |
General Comments 0
You need to be logged in to leave comments.
Login now