I'm trying to use Rails integration tests to test across
controllers/actions. Unfortunately, the integration tests break other
(unit) tests because the integration tests leave around data in the
session. We can tell this because the tests that fail involve asserts
on redirects that should happen when the session is empty (i.e., when
the user is not logged in). Here's what I'm doing:
s = open_session do |s|
# rest of the test here...
Additionally, I've tried other ways of resetting the session,
including skipping the open_session block and just calling reset! in
teardown, as well as 'get "/user/logout"' to force the session to be
reset through the app.
The api documentation as well as the Rails Recipe book suggest that
this should work. Am I missing something simple or does someone have
some insight to this problem? Thanks!