When testing a rails 7 controller everything works splendidly until I get a redirect and then execute a follow_redirect!. At this point the session mysteriously disappears and my tests can no longer continue...very limiting.
Very dumbed down, hypothetical example:
post some_url, params { yada: 'foo' }
assert_not_nil session[:yada]
assert_redirect some_redirect_url
follow_redirect!
assert_not_nil session[:yada] # This assertion fails, the session is gone