repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
+ repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
+ repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
+ # TODO: why the following route is required?
+ repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
repository_views.connect 'projects/:id/repository/:action/*path'
end
:controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :rev => '2'
)
end
+
+ def test_raw_routing
+ assert_routing(
+ {:method => :get, :path => '/projects/restmine/repository/raw/path/to/file.c'},
+ :controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :format => 'raw'
+ )
+ end
+
+ def test_raw_routing_with_revision
+ assert_routing(
+ {:method => :get, :path => '/projects/restmine/repository/revisions/2/raw/path/to/file.c'},
+ :controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :format => 'raw', :rev => '2'
+ )
+ end
def test_annotate_routing
assert_routing(