Merge branch 'next-minor' into develop

This commit is contained in:
Dennis Schubert 2016-09-04 03:01:55 +02:00
commit d2a0528b56
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
3 changed files with 1 additions and 24 deletions

View file

@ -3,7 +3,7 @@
# the COPYRIGHT file.
class UsersController < ApplicationController
before_action :authenticate_user!, except: %i(new create public user_photo)
before_action :authenticate_user!, except: %i(new create public)
respond_to :html
def edit
@ -118,16 +118,6 @@ class UsersController < ApplicationController
redirect_to current_user.exported_photos_file.url
end
def user_photo
username = params[:username].split('@')[0]
user = User.find_by_username(username)
if user.present?
redirect_to user.image_url
else
render :nothing => true, :status => 404
end
end
def confirm_email
if current_user.confirm_email(params[:token])
flash[:notice] = I18n.t("users.confirm_email.email_confirmed", email: current_user.email)

View file

@ -172,7 +172,6 @@ Diaspora::Application.routes.draw do
end
end
get '/u/:username' => 'people#show', :as => 'user_profile', :constraints => { :username => /[^\/]+/ }
get '/u/:username/profile_photo' => 'users#user_photo', :constraints => { :username => /[^\/]+/ }
# External

View file

@ -47,18 +47,6 @@ describe UsersController, :type => :controller do
end
end
describe 'user_photo' do
it 'should return the url of the users profile photo' do
get :user_photo, :username => @user.username
expect(response).to redirect_to(@user.profile.image_url)
end
it 'should 404 if no user is found' do
get :user_photo, :username => 'none'
expect(response).not_to be_success
end
end
describe '#public' do
it 'renders xml if atom is requested' do
sm = FactoryGirl.create(:status_message, :public => true, :author => @user.person)