@@ -226,6 +226,7 RedmineApp::Application.routes.draw do | |||||
226 | get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions' |
|
226 | get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions' | |
227 | get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', |
|
227 | get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', | |
228 | :controller => 'repositories', |
|
228 | :controller => 'repositories', | |
|
229 | :format => false, | |||
229 | :constraints => { |
|
230 | :constraints => { | |
230 | :action => /(browse|show|entry|raw|annotate|diff)/, |
|
231 | :action => /(browse|show|entry|raw|annotate|diff)/, | |
231 | :rev => /[a-z0-9\.\-_]+/ |
|
232 | :rev => /[a-z0-9\.\-_]+/ | |
@@ -244,6 +245,7 RedmineApp::Application.routes.draw do | |||||
244 | delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' |
|
245 | delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' | |
245 | get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', |
|
246 | get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', | |
246 | :controller => 'repositories', |
|
247 | :controller => 'repositories', | |
|
248 | :format => false, | |||
247 | :constraints => { |
|
249 | :constraints => { | |
248 | :action => /(browse|show|entry|raw|annotate|diff)/, |
|
250 | :action => /(browse|show|entry|raw|annotate|diff)/, | |
249 | :rev => /[a-z0-9\.\-_]+/ |
|
251 | :rev => /[a-z0-9\.\-_]+/ |
@@ -140,9 +140,11 class RoutingRepositoriesTest < ActionController::IntegrationTest | |||||
140 | ) |
|
140 | ) | |
141 | assert_routing( |
|
141 | assert_routing( | |
142 | { :method => 'get', |
|
142 | { :method => 'get', | |
143 |
:path => "/projects/redmine/repository/revisions/2457/diff |
|
143 | :path => "/projects/redmine/repository/revisions/2457/diff" }, | |
144 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', |
|
144 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', | |
145 | :rev => '2457', :format => 'diff' } |
|
145 | :rev => '2457', :format => 'diff' }, | |
|
146 | {}, | |||
|
147 | { :format => 'diff' } | |||
146 | ) |
|
148 | ) | |
147 | assert_routing( |
|
149 | assert_routing( | |
148 | { :method => 'get', |
|
150 | { :method => 'get', | |
@@ -152,6 +154,14 class RoutingRepositoriesTest < ActionController::IntegrationTest | |||||
152 | ) |
|
154 | ) | |
153 | assert_routing( |
|
155 | assert_routing( | |
154 | { :method => 'get', |
|
156 | { :method => 'get', | |
|
157 | :path => "/projects/redmine/repository/revisions/2/diff/#{@path_hash[:path]}" }, | |||
|
158 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', | |||
|
159 | :path => @path_hash[:param], :rev => '2', :format => 'diff' }, | |||
|
160 | {}, | |||
|
161 | { :format => 'diff' } | |||
|
162 | ) | |||
|
163 | assert_routing( | |||
|
164 | { :method => 'get', | |||
155 | :path => "/projects/redmine/repository/revisions/2/entry/#{@path_hash[:path]}" }, |
|
165 | :path => "/projects/redmine/repository/revisions/2/entry/#{@path_hash[:path]}" }, | |
156 | { :controller => 'repositories', :action => 'entry', :id => 'redmine', |
|
166 | { :controller => 'repositories', :action => 'entry', :id => 'redmine', | |
157 | :path => @path_hash[:param], :rev => '2' } |
|
167 | :path => @path_hash[:param], :rev => '2' } | |
@@ -209,9 +219,11 class RoutingRepositoriesTest < ActionController::IntegrationTest | |||||
209 | ) |
|
219 | ) | |
210 | assert_routing( |
|
220 | assert_routing( | |
211 | { :method => 'get', |
|
221 | { :method => 'get', | |
212 |
:path => "/projects/redmine/repository/foo/revisions/2457/diff |
|
222 | :path => "/projects/redmine/repository/foo/revisions/2457/diff" }, | |
213 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo', |
|
223 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo', | |
214 | :rev => '2457', :format => 'diff' } |
|
224 | :rev => '2457', :format => 'diff' }, | |
|
225 | {}, | |||
|
226 | { :format => 'diff' } | |||
215 | ) |
|
227 | ) | |
216 | assert_routing( |
|
228 | assert_routing( | |
217 | { :method => 'get', |
|
229 | { :method => 'get', | |
@@ -221,6 +233,14 class RoutingRepositoriesTest < ActionController::IntegrationTest | |||||
221 | ) |
|
233 | ) | |
222 | assert_routing( |
|
234 | assert_routing( | |
223 | { :method => 'get', |
|
235 | { :method => 'get', | |
|
236 | :path => "/projects/redmine/repository/foo/revisions/2/diff/#{@path_hash[:path]}" }, | |||
|
237 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo', | |||
|
238 | :path => @path_hash[:param], :rev => '2', :format => 'diff' }, | |||
|
239 | {}, | |||
|
240 | { :format => 'diff' } | |||
|
241 | ) | |||
|
242 | assert_routing( | |||
|
243 | { :method => 'get', | |||
224 | :path => "/projects/redmine/repository/foo/revisions/2/entry/#{@path_hash[:path]}" }, |
|
244 | :path => "/projects/redmine/repository/foo/revisions/2/entry/#{@path_hash[:path]}" }, | |
225 | { :controller => 'repositories', :action => 'entry', :id => 'redmine', :repository_id => 'foo', |
|
245 | { :controller => 'repositories', :action => 'entry', :id => 'redmine', :repository_id => 'foo', | |
226 | :path => @path_hash[:param], :rev => '2' } |
|
246 | :path => @path_hash[:param], :rev => '2' } |
General Comments 0
You need to be logged in to leave comments.
Login now