Okay, I give up. I have been trying to set session values in a controller, but no matter what, once the request is made and inside the controller, the session is empty. What''s the correct way? I have tried session[''whatever''] = something controller.stub!(:session).and_return(session) I tried creating a new session, but nothing seems to do it. I''m sure there''s something I''m missing. Suggestions? Thanks, Steve
i''ve done this in controller specs session[:whatever] = something do_it --linoj On Oct 24, 2007, at 9:06 PM, Steve wrote:> Okay, I give up. I have been trying to set session values in a > controller, > but no matter what, once the request is made and inside the > controller, > the session is empty. What''s the correct way? I have tried > > session[''whatever''] = something > controller.stub!(:session).and_return(session) > > I tried creating a new session, but nothing seems to do it. I''m sure > there''s something I''m missing. Suggestions? > > Thanks, > Steve > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On Wed, 24 Oct 2007 21:29:39 -0400, Jonathan Linowes wrote:> i''ve done this in controller specs > > session[:whatever] = something > do_it >Yeah, I did that, and it was turning up nil when I actually made the request.
Steve wrote:> On Wed, 24 Oct 2007 21:29:39 -0400, Jonathan Linowes wrote: > >> i''ve done this in controller specs >> >> session[:whatever] = something >> do_it >> > > Yeah, I did that, and it was turning up nil when I actually made the > request.I know your post was from over a year ago, but I''ll post this anyway. I think the problem with Radiant is that in the SiteController it has session :off as the first line. So sessions will be disabled for any controller than inherits from SiteController as I understand it. My next step is to figure out why and see if re-enabling sessions is safe. -- Posted via http://www.ruby-forum.com/.