Commit 8dc19494 authored by Long Nguyen's avatar Long Nguyen

Remove unused code, update spec, and update changelog

parent c0f02aad
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.8.0 (unreleased) v 8.8.0 (unreleased)
- Snippets tab under user profile. !4001 (Long Nguyen)
- Remove future dates from contribution calendar graph. - Remove future dates from contribution calendar graph.
- Fix error when visiting commit builds page before build was updated - 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 - Add 'l' shortcut to open Label dropdown on issuables and 'i' to create new issue on a project
......
...@@ -10,29 +10,11 @@ class SnippetsController < ApplicationController ...@@ -10,29 +10,11 @@ class SnippetsController < ApplicationController
# Allow destroy snippet # Allow destroy snippet
before_action :authorize_admin_snippet!, only: [:destroy] 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' layout 'snippets'
respond_to :html 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 def new
@snippet = PersonalSnippet.new @snippet = PersonalSnippet.new
end end
......
...@@ -27,18 +27,10 @@ end ...@@ -27,18 +27,10 @@ end
# PUT /snippets/:id(.:format) snippets#update # PUT /snippets/:id(.:format) snippets#update
# DELETE /snippets/:id(.:format) snippets#destroy # DELETE /snippets/:id(.:format) snippets#destroy
describe SnippetsController, "routing" do 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 it "to #raw" do
expect(get("/snippets/1/raw")).to route_to('snippets#raw', id: '1') expect(get("/snippets/1/raw")).to route_to('snippets#raw', id: '1')
end end
it "to #index" do
expect(get("/snippets")).to route_to('snippets#index')
end
it "to #create" do it "to #create" do
expect(post("/snippets")).to route_to('snippets#create') expect(post("/snippets")).to route_to('snippets#create')
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment