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
Jérome Perrin
gitlab-ce
Commits
8dc19494
Commit
8dc19494
authored
May 05, 2016
by
Long Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code, update spec, and update changelog
parent
c0f02aad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
27 deletions
+2
-27
CHANGELOG
CHANGELOG
+1
-0
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+1
-19
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+0
-8
No files found.
CHANGELOG
View file @
8dc19494
Please view this file on the master branch, on stable branches it's out of date.
v 8.8.0 (unreleased)
- Snippets tab under user profile. !4001 (Long Nguyen)
- Remove future dates from contribution calendar graph.
- Fix error when visiting commit builds page before build was updated
- Add 'l' shortcut to open Label dropdown on issuables and 'i' to create new issue on a project
...
...
app/controllers/snippets_controller.rb
View file @
8dc19494
...
...
@@ -10,29 +10,11 @@ class SnippetsController < ApplicationController
# Allow destroy snippet
before_action
:authorize_admin_snippet!
,
only:
[
:destroy
]
skip_before_action
:authenticate_user!
,
only:
[
:
index
,
:user_index
,
:
show
,
:raw
]
skip_before_action
:authenticate_user!
,
only:
[
:show
,
:raw
]
layout
'snippets'
respond_to
:html
def
index
if
params
[
:username
].
present?
@user
=
User
.
find_by
(
username:
params
[
:username
])
render_404
and
return
unless
@user
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
{
filter: :by_user
,
user:
@user
,
scope:
params
[
:scope
]
}).
page
(
params
[
:page
])
render
'index'
else
redirect_to
(
current_user
?
dashboard_snippets_path
:
explore_snippets_path
)
end
end
def
new
@snippet
=
PersonalSnippet
.
new
end
...
...
spec/routing/routing_spec.rb
View file @
8dc19494
...
...
@@ -27,18 +27,10 @@ end
# PUT /snippets/:id(.:format) snippets#update
# DELETE /snippets/:id(.:format) snippets#destroy
describe
SnippetsController
,
"routing"
do
it
"to #user_index"
do
expect
(
get
(
"/s/User"
)).
to
route_to
(
'snippets#index'
,
username:
'User'
)
end
it
"to #raw"
do
expect
(
get
(
"/snippets/1/raw"
)).
to
route_to
(
'snippets#raw'
,
id:
'1'
)
end
it
"to #index"
do
expect
(
get
(
"/snippets"
)).
to
route_to
(
'snippets#index'
)
end
it
"to #create"
do
expect
(
post
(
"/snippets"
)).
to
route_to
(
'snippets#create'
)
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