[rspec-users] Where is current_user?

David Chelimsky dchelimsky at gmail.com
Mon Oct 20 08:00:01 EDT 2008


On Mon, Oct 20, 2008 at 6:53 AM, Harry Bishop <lists at ruby-forum.com> wrote:
> Scott Taylor wrote:
>> On Oct 20, 2008, at 1:00 AM, Harry Bishop wrote:
>>
>>>  before(:each) do
>>> true.
>>> end
>>> action.
>>>
>>> A mock would require rebuilding the User model for all the checks done
>>> in the controller and I am trying to avoid that by using a fixture
>>> called from the database to test the true interaction between user and
>>> motion.
>>
>> Not necessarily.  Have you looked into using a null_object mock?
>>
>> Scott
>
> Yes, I tried null object but it doesn't get past is_showable? which says
> it has a nil object passed in.
> The idea is to use @current_user to determine if @motion is shown on the
> view.  So how come @current_user isn't available in the controller?

Can you please post the controller code?

>
> TIA,
> HR
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list