I spent way too much time today figuring out why this doesn't work as expected:
def test_something
  get :list, nil, {:user_id => 1}
  get :list, nil, {:user_id => 2}
end
I expected the second request to have session[:user_id] == 2. That's not the case. Functional tests in Rails are designed to make only one request per test and thus the second assignment doesn't change the session data. To make it work as expected, split it into multiple tests:
def test_something
  get :list, nil, {:user_id => 1}
end

def test_something_else
  get :list, nil, {:user_id => 2}
end