diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 7ba5e2790..750799a14 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -83,7 +83,7 @@ class PeopleController < ApplicationController def show @person = Person.find_from_guid_or_username(params) - raise(ActiveRecord::RecordNotFound) if remote_profile_with_no_user_session? + authenticate_user! if remote_profile_with_no_user_session? return redirect_to :back, :notice => t("people.show.closed_account") if @person.closed_account? @post_type = :all diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index ecbe70e4f..5e85421a3 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -287,11 +287,12 @@ describe PeopleController do end end - it 'throws 404 if the person is remote' do + it 'forces to sign in if the person is remote' do p = FactoryGirl.create(:person) get :show, :id => p.to_param - response.status.should == 404 + response.should be_redirect + response.should redirect_to new_user_session_path end end