Creating an authentication system from scratch is simple with Rails 3.1, thanks to these two RailsCasts. What's left unexplained, however, is how to take advantage of this in your controller and model tests.
Then you're good! Your session now behaves like it normally should.