visible_person_by_id should check against self.person.id

This commit is contained in:
Raphael 2010-08-17 19:51:29 -07:00
parent d2f50008f7
commit 9f9395bc9c
2 changed files with 5 additions and 2 deletions

View file

@ -290,7 +290,7 @@ class User
end end
def visible_person_by_id( id ) def visible_person_by_id( id )
return self if id == self.id return self if id == person.id
friends.detect{|x| x.id == ensure_bson( id ) } friends.detect{|x| x.id == ensure_bson( id ) }
end end

View file

@ -14,5 +14,8 @@ describe PeopleController do
get :index, :q => "Eu" get :index, :q => "Eu"
end end
it 'should go to the current_user show page' do
get :show, :id => @user.person.id
end
end end