Forum: Ruby on Rails Integration test, sessions, and acts_as_authenticated

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Brad E. (Guest)
on 2006-12-31 01:38
(Received via mailing list)
Just starting out with integration tests here. I am having problems
keeping a session between requests, using acts_as_authenticated. Here
is a sample from the test:

login_as :store_user
post "/order/checkout"
assert_response :success

The checkout method is protected with a
before_filter :login_required. The user is not being logged in; the
filter returns false and the assert fails.

If I printline some debug statements in there to inspect the session,
I see that the user only exists in the session between the login_as
and post methods. The session ID is the same throughout the test, but
the "user" key disappears from the session somewhere during the post
request. Is there something I'm missing?

This topic is locked and can not be replied to.