Rspec story - access session

Very simple, but not googlable: how do I access ‘session’ in my story?
In rspec controller specs I could just say session[:user] for example,
but this doesn’t work here.

On Thu, Aug 28, 2008 at 8:41 AM, snitko [email protected] wrote:

Very simple, but not googlable: how do I access ‘session’ in my story?
In rspec controller specs I could just say session[:user] for example,
but this doesn’t work here.

Hi,

There’s no support for what you are trying to do. RailsStory, the
object that rspec/rails scenarios run in, is derived from
ActionController::Integration::Session, which is what rails
integration tests run in.

This is a bit confusing, but ActionController::Integration::Session is
a metaphor for an interactive session between a user and the system,
not the browser session object that you can access from your
controllers.

ActionController::Integration::Session doesn’t provide access to the
browser session as it is actually designed to let you run more than
one browser session within one test.

Hope that makes sense.

Cheers,
David

ps - feel free to post rspec questions to the rspec-users mailing list
or google group:

http://rubyforge.org/mailman/listinfo/rspec-users
http://groups.google.com/group/rspec