Browse files

Force user to authenticate instead of raising error

  • Loading branch information...
1 parent 531c5b0 commit 125e45cdba72dc4834b3a46f5ec5150930d5844e Marek Lewandowski committed Sep 29, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −1 app/controllers/people_controller.rb
  2. +3 −2 spec/controllers/people_controller_spec.rb
View
2 app/controllers/people_controller.rb
@@ -83,7 +83,7 @@ def hashes_for_people(people, aspects)
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
View
5 spec/controllers/people_controller_spec.rb
@@ -287,11 +287,12 @@
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

0 comments on commit 125e45c

Please sign in to comment.