summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--app/controllers/snippets_controller.rb20
-rw-r--r--spec/routing/routing_spec.rb8
3 files changed, 2 insertions, 27 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 558897ad892..6c044192d06 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
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
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index 2daceed039b..f0bd842ca56 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -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
diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb
index 1527eddfa48..9deffd0a1e3 100644
--- a/spec/routing/routing_spec.rb
+++ b/spec/routing/routing_spec.rb
@@ -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