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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
334805ec86cb3fe1ac2eda776a921fb2?d=identicon&s=25 Brad Ediger (Guest)
on 2006-12-31 00: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?

Thanks,
Brad
This topic is locked and can not be replied to.