[rspec-users] Getting to the session from Stories

Mikel Lindsaar raasdnil at gmail.com
Sat Apr 5 21:55:19 EDT 2008


Hey all,

In a story I want to say

Given "A logged in user" do
  sesson[:logged_in] = true
  etc...
end

But the session method doesn't have anything to bind to, I get the
error '... while evaluating nil.session...'

Any ideas?

The fact that the user is logged in or not, doesn't matter to this
story, so I just want to stub it out.

The other way is stubbing out all the authentication methods, but that
is more typing :)  (less than this message to find out how to do it
the short way, but you know, once you think you need to do something,
doing it the longer way just seems wrong :D

Regards

Mikel


More information about the rspec-users mailing list