[rspec-users] Help in Stubing is_admin? method

Ashley Moran ashley.moran at patchspace.co.uk
Tue Oct 20 15:13:46 EDT 2009

On 20 Oct 2009, at 19:31, elza.morelli at tagview.com.br wrote:

> Thank you for your replay. I did not mention that I have a method  
> called in before_filter to set @user.
> before_filter :find_current, :only =>  
> [:show, :edit, :update, :destroy]
> The method is
>  def find_current
>    @user = User.find(get_param(:id, :integer))
>  end
> After this call the controller is
>  def edit
>    @user = current_user if !is_admin?
>  end


Copying this back in to the main list as it is more valuable to  
discuss it there.

Can you please confirm that you are not confusing the concept of  
"logged in user" and "user to be edited with the Users controller"?   
That is what appears to be happening to me.



More information about the rspec-users mailing list