private; def requires_user
if user.nil?
if request.format.html?
session[ :redirected_from ] ||= request.env[ "REQUEST_URI" ]
redirect_to( sign_in_url )
else
render( :status => 403, :text => 'An authenticated user is required.' )
end
end
end
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of David Chelimsky
Sent: Wednesday, May 27, 2009 5:55 PM
To: rspec-users
Subject: Re: [rspec-users] spec for authenticated user
> before_filter :requires_user,
> :except => :create
>
> def show
> #-------
>
> # the currently authenticated user
> @user = user
>
> end
>
> How shall we check the currently authenticated user using rspec?
What's in requires_user?
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users