Merge branch 'next-minor' into develop
This commit is contained in:
commit
d2a0528b56
3 changed files with 1 additions and 24 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
class UsersController < ApplicationController
|
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
|
respond_to :html
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
|
@ -118,16 +118,6 @@ class UsersController < ApplicationController
|
||||||
redirect_to current_user.exported_photos_file.url
|
redirect_to current_user.exported_photos_file.url
|
||||||
end
|
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
|
def confirm_email
|
||||||
if current_user.confirm_email(params[:token])
|
if current_user.confirm_email(params[:token])
|
||||||
flash[:notice] = I18n.t("users.confirm_email.email_confirmed", email: current_user.email)
|
flash[:notice] = I18n.t("users.confirm_email.email_confirmed", email: current_user.email)
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,6 @@ Diaspora::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
get '/u/:username' => 'people#show', :as => 'user_profile', :constraints => { :username => /[^\/]+/ }
|
get '/u/:username' => 'people#show', :as => 'user_profile', :constraints => { :username => /[^\/]+/ }
|
||||||
get '/u/:username/profile_photo' => 'users#user_photo', :constraints => { :username => /[^\/]+/ }
|
|
||||||
|
|
||||||
# External
|
# External
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,18 +47,6 @@ describe UsersController, :type => :controller do
|
||||||
end
|
end
|
||||||
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
|
describe '#public' do
|
||||||
it 'renders xml if atom is requested' do
|
it 'renders xml if atom is requested' do
|
||||||
sm = FactoryGirl.create(:status_message, :public => true, :author => @user.person)
|
sm = FactoryGirl.create(:status_message, :public => true, :author => @user.person)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue