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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
718ec26a
Commit
718ec26a
authored
Mar 24, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Routing updated to support global snippets
parent
9e2525cb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
config/routes.rb
config/routes.rb
+8
-0
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+45
-0
No files found.
config/routes.rb
View file @
718ec26a
...
@@ -100,6 +100,14 @@ Gitlab::Application.routes.draw do
...
@@ -100,6 +100,14 @@ Gitlab::Application.routes.draw do
get
"errors/githost"
get
"errors/githost"
resources
:snippets
do
member
do
get
"raw"
get
"my"
end
end
match
"/s/:username"
=>
"snippets#user_index"
,
as: :user_snippets
,
constraints:
{
username:
/.*/
}
#
#
# Profile Area
# Profile Area
#
#
...
...
spec/routing/routing_spec.rb
View file @
718ec26a
...
@@ -25,6 +25,51 @@ describe "Mounted Apps", "routing" do
...
@@ -25,6 +25,51 @@ describe "Mounted Apps", "routing" do
end
end
end
end
# snippets GET /snippets(.:format) snippets#index
# POST /snippets(.:format) snippets#create
# new_snippet GET /snippets/new(.:format) snippets#new
# edit_snippet GET /snippets/:id/edit(.:format) snippets#edit
# snippet GET /snippets/:id(.:format) snippets#show
# PUT /snippets/:id(.:format) snippets#update
# DELETE /snippets/:id(.:format) snippets#destroy
describe
SnippetsController
,
"routing"
do
it
"to #user_index"
do
get
(
"/s/User"
).
should
route_to
(
'snippets#user_index'
,
username:
'User'
)
end
it
"to #raw"
do
get
(
"/snippets/1/raw"
).
should
route_to
(
'snippets#raw'
,
id:
'1'
)
end
it
"to #index"
do
get
(
"/snippets"
).
should
route_to
(
'snippets#index'
)
end
it
"to #create"
do
post
(
"/snippets"
).
should
route_to
(
'snippets#create'
)
end
it
"to #new"
do
get
(
"/snippets/new"
).
should
route_to
(
'snippets#new'
)
end
it
"to #edit"
do
get
(
"/snippets/1/edit"
).
should
route_to
(
'snippets#edit'
,
id:
'1'
)
end
it
"to #show"
do
get
(
"/snippets/1"
).
should
route_to
(
'snippets#show'
,
id:
'1'
)
end
it
"to #update"
do
put
(
"/snippets/1"
).
should
route_to
(
'snippets#update'
,
id:
'1'
)
end
it
"to #destroy"
do
delete
(
"/snippets/1"
).
should
route_to
(
'snippets#destroy'
,
id:
'1'
)
end
end
# help GET /help(.:format) help#index
# help GET /help(.:format) help#index
# help_permissions GET /help/permissions(.:format) help#permissions
# help_permissions GET /help/permissions(.:format) help#permissions
# help_workflow GET /help/workflow(.:format) help#workflow
# help_workflow GET /help/workflow(.:format) help#workflow
...
...
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