On Sat, Mar 8, 2008 at 4:37 PM, Steve <vertebrate at gmail.com>
wrote:> Can anyone tell me what I''m doing wrong here?
>
> it ''should try to set the current user from the session''
do
> controller.session[SessionKeys::USER_ID] = 1
> user = mock_model(User)
> User.stub!(:find).and_return(user)
> User.should_receive(:find).with(1).and_return(user)
> controller.should_receive(:set_current_user)
> do_request
> end
>
> When I watch the spec with my debugger, when it gets to the code, the
> session is empty, and the spec fails. What would be causing this? Am I
> setting the session wrong? I have also tried just session, and
> request.session with the same results.
You''ve uncovered a bug. I forwarded this mail to
http://rspec.lighthouseapp.com (please put bug reports there in the
future), creating
http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/331.
Fixed in http://github.com/dchelimsky/rspec/commit/097d63d.
Cheers,
David
>
> Thanks,
> Steve
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>