Skip to content
Extraits de code Groupes Projets
Valider 6e1bd721 rédigé par Florian Staudacher's avatar Florian Staudacher
Parcourir les fichiers

fix /u/[username] route

parent 0bbf304e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -174,8 +174,10 @@ class PeopleController < ApplicationController
private
def find_person
person_id = params[:id] || params[:person_id]
@person = Person.find_from_guid_or_username({id: person_id})
@person = Person.find_from_guid_or_username({
id: params[:id] || params[:person_id],
username: params[:username]
})
# view this profile on the home pod, if you don't want to sign in...
authenticate_user! if remote_profile_with_no_user_session?
......
......@@ -174,6 +174,11 @@ describe PeopleController, :type => :controller do
expect(response.code).to eq("404")
end
it 'finds a person via username' do
get :show, username: @user.username
expect(assigns(:person)).to eq(@user.person)
end
it 'redirects home for closed account' do
@person = FactoryGirl.create(:person, :closed_account => true)
get :show, :id => @person.to_param
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter