Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
884eb732
Commit
884eb732
authored
Sep 17, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable tree resource, remove old tree routes
parent
2ddb1917
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
27 deletions
+10
-27
config/routes.rb
config/routes.rb
+3
-13
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+7
-14
No files found.
config/routes.rb
View file @
884eb732
...
...
@@ -122,24 +122,14 @@ Gitlab::Application.routes.draw do
end
member
do
get
"tree"
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
}
get
"logs_tree"
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
}
get
"blob"
,
constraints:
{
id:
/[a-zA-Z.0-9\/_\-]+/
,
path:
/.*/
}
# tree viewer
get
"tree/:path"
=>
"refs#tree"
,
as: :tree_file
,
constraints:
{
id:
/[a-zA-Z.0-9\/_\-]+/
,
path:
/.*/
}
# tree viewer
# tree viewer logs
get
"logs_tree"
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
}
get
"logs_tree/:path"
=>
"refs#logs_tree"
,
as: :logs_file
,
constraints:
{
...
...
@@ -217,7 +207,7 @@ Gitlab::Application.routes.draw do
# resources :blame, only: [:show], constraints: {id: /.+/}
# resources :blob, only: [:show], constraints: {id: /.+/}
# resources :raw, only: [:show], constraints: {id: /.+/}
#
resources :tree, only: [:show], constraints: {id: /.+/}
resources
:tree
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
end
root
to:
"dashboard#index"
...
...
spec/routing/project_routing_spec.rb
View file @
884eb732
...
...
@@ -192,10 +192,8 @@ describe ProtectedBranchesController, "routing" do
end
# switch_project_refs GET /:project_id/switch(.:format) refs#switch
# tree_project_ref GET /:project_id/:id/tree(.:format) refs#tree
# logs_tree_project_ref GET /:project_id/:id/logs_tree(.:format) refs#logs_tree
# blob_project_ref GET /:project_id/:id/blob(.:format) refs#blob
#
tree_file_project_ref GET /:project_id/:id/tree/:path(.:format) refs#
tree
#
logs_tree_project_ref GET /:project_id/:id/logs_tree(.:format) refs#logs_
tree
# logs_file_project_ref GET /:project_id/:id/logs_tree/:path(.:format) refs#logs_tree
# blame_file_project_ref GET /:project_id/:id/blame/:path(.:format) refs#blame
describe
RefsController
,
"routing"
do
...
...
@@ -203,11 +201,6 @@ describe RefsController, "routing" do
get
(
"/gitlabhq/switch"
).
should
route_to
(
'refs#switch'
,
project_id:
'gitlabhq'
)
end
it
"to #tree"
do
get
(
"/gitlabhq/stable/tree"
).
should
route_to
(
'refs#tree'
,
project_id:
'gitlabhq'
,
id:
'stable'
)
get
(
"/gitlabhq/stable/tree/foo/bar/baz"
).
should
route_to
(
'refs#tree'
,
project_id:
'gitlabhq'
,
id:
'stable'
,
path:
'foo/bar/baz'
)
end
it
"to #logs_tree"
do
get
(
"/gitlabhq/stable/logs_tree"
).
should
route_to
(
'refs#logs_tree'
,
project_id:
'gitlabhq'
,
id:
'stable'
)
get
(
"/gitlabhq/stable/logs_tree/foo/bar/baz"
).
should
route_to
(
'refs#logs_tree'
,
project_id:
'gitlabhq'
,
id:
'stable'
,
path:
'foo/bar/baz'
)
...
...
@@ -406,6 +399,12 @@ describe NotesController, "routing" do
end
end
describe
TreeController
,
"routing"
do
it
"to #show"
do
get
(
"/gitlabhq/tree/master/app/models/project.rb"
).
should
route_to
(
'tree#show'
,
project_id:
'gitlabhq'
,
id:
'master/app/models/project.rb'
)
end
end
# TODO: Pending
#
# /:project_id/blame/*path
...
...
@@ -457,10 +456,4 @@ describe "pending routing" do
get
(
"/gitlabhq/raw/master/app/models/project.rb"
).
should
route_to
(
'raw#show'
,
project_id:
'gitlabhq'
,
id:
'master/app/models/project.rb'
)
end
end
describe
"/:project_id/tree/:id"
do
it
"routes to a ref with a path"
do
get
(
"/gitlabhq/tree/master/app/models/project.rb"
).
should
route_to
(
'tree#show'
,
project_id:
'gitlabhq'
,
id:
'master/app/models/project.rb'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment