@@ -224,7 +224,11 ActionController::Routing::Routes.draw do |map| | |||
|
224 | 224 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' |
|
225 | 225 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' |
|
226 | 226 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' |
|
227 | repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
|
227 | 228 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
229 | repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' | |
|
230 | # TODO: why the following route is required? | |
|
231 | repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' | |
|
228 | 232 | repository_views.connect 'projects/:id/repository/:action/*path' |
|
229 | 233 | end |
|
230 | 234 |
@@ -144,6 +144,20 class RepositoriesControllerTest < ActionController::TestCase | |||
|
144 | 144 | :controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :rev => '2' |
|
145 | 145 | ) |
|
146 | 146 | end |
|
147 | ||
|
148 | def test_raw_routing | |
|
149 | assert_routing( | |
|
150 | {:method => :get, :path => '/projects/restmine/repository/raw/path/to/file.c'}, | |
|
151 | :controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :format => 'raw' | |
|
152 | ) | |
|
153 | end | |
|
154 | ||
|
155 | def test_raw_routing_with_revision | |
|
156 | assert_routing( | |
|
157 | {:method => :get, :path => '/projects/restmine/repository/revisions/2/raw/path/to/file.c'}, | |
|
158 | :controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :format => 'raw', :rev => '2' | |
|
159 | ) | |
|
160 | end | |
|
147 | 161 | |
|
148 | 162 | def test_annotate_routing |
|
149 | 163 | assert_routing( |
General Comments 0
You need to be logged in to leave comments.
Login now