@@ -214,6 +214,9 RedmineApp::Application.routes.draw do | |||||
214 | get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats' |
|
214 | get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats' | |
215 | get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph' |
|
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 | get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision' |
|
220 | get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision' | |
218 | get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision' |
|
221 | get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision' | |
219 | post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue' |
|
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 | get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', |
|
231 | get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', | |
229 | :controller => 'repositories', |
|
232 | :controller => 'repositories', | |
230 | :constraints => { |
|
233 | :constraints => { | |
231 |
:action => /(browse|show|entry| |
|
234 | :action => /(browse|show|entry|annotate|diff)/, | |
232 | :rev => /[a-z0-9\.\-_]+/ |
|
235 | :rev => /[a-z0-9\.\-_]+/ | |
233 | } |
|
236 | } | |
234 |
|
237 | |||
235 | get 'projects/:id/repository/statistics', :to => 'repositories#stats' |
|
238 | get 'projects/:id/repository/statistics', :to => 'repositories#stats' | |
236 | get 'projects/:id/repository/graph', :to => 'repositories#graph' |
|
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 | get 'projects/:id/repository/revisions', :to => 'repositories#revisions' |
|
244 | get 'projects/:id/repository/revisions', :to => 'repositories#revisions' | |
239 | get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' |
|
245 | get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' | |
240 | get 'projects/:id/repository/revision', :to => 'repositories#revision' |
|
246 | get 'projects/:id/repository/revision', :to => 'repositories#revision' | |
@@ -249,7 +255,7 RedmineApp::Application.routes.draw do | |||||
249 | get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', |
|
255 | get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', | |
250 | :controller => 'repositories', |
|
256 | :controller => 'repositories', | |
251 | :constraints => { |
|
257 | :constraints => { | |
252 |
:action => /(browse|show|entry| |
|
258 | :action => /(browse|show|entry|annotate|diff)/, | |
253 | :rev => /[a-z0-9\.\-_]+/ |
|
259 | :rev => /[a-z0-9\.\-_]+/ | |
254 | } |
|
260 | } | |
255 | get 'projects/:id/repository/:repository_id/:format(/*path(.:ext))', :to => 'repositories#entry', :format => /raw/ |
|
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 | assert_routing( |
|
135 | assert_routing( | |
136 | { :method => 'get', |
|
136 | { :method => 'get', | |
137 |
:path => "/projects/redmine/repository/ |
|
137 | :path => "/projects/redmine/repository/changes" }, | |
138 |
{ :controller => 'repositories', :action => 'changes', :id => 'redmine' |
|
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'} |
|
|||
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 | assert_routing( |
|
160 | assert_routing( | |
148 | { :method => 'get', |
|
161 | { :method => 'get', | |
149 | :path => "/projects/redmine/repository/revisions/2457/diff" }, |
|
162 | :path => "/projects/redmine/repository/revisions/2457/diff" }, | |
@@ -215,16 +228,29 class RoutingRepositoriesTest < ActionController::IntegrationTest | |||||
215 | ) |
|
228 | ) | |
216 | assert_routing( |
|
229 | assert_routing( | |
217 | { :method => 'get', |
|
230 | { :method => 'get', | |
218 |
:path => "/projects/redmine/repository/foo/ |
|
231 | :path => "/projects/redmine/repository/foo/changes" }, | |
219 |
{ :controller => 'repositories', :action => 'changes', :id => 'redmine', :repository_id => 'foo' |
|
232 | { :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'} |
|
|||
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 | assert_routing( |
|
254 | assert_routing( | |
229 | { :method => 'get', |
|
255 | { :method => 'get', | |
230 | :path => "/projects/redmine/repository/foo/revisions/2457/diff" }, |
|
256 | :path => "/projects/redmine/repository/foo/revisions/2457/diff" }, |
General Comments 0
You need to be logged in to leave comments.
Login now