Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

rspec + authlogic -> unable to ever log out during tests #75

Open
xxx opened this Issue · 3 comments

3 participants

@xxx
xxx commented

This is a bit of a strange one. I'm testing my logout action, simply testing to see if the user is logged-out after hitting the action.

It works fine in the browser, but never logs the user out in tests (at least user.reload.logged_in? is still true.) Logging in was fine once I discovered activate_authlogic, but logging out continues to elude me.

I understand that you don't use rspec, but I have no other recourse at this point. I've been trying for an hour to make a 5-line test I've written 20 times before to work and i'm about to slit my wrists here.

@johnf

@xxx did you ever solve this? I'm seeing the same issue

@xxx

user.logged_in? after destroying the session still returns true in my tests, but my guess is it's due to the test environment not being exactly the same as the real world. session[:user_credentials] is cleared on logout as you would expect, so that's what I'm testing for now.

@softwaregravy

I'm pretty sure I've encountered this too -- I posted to stack overflow before checking here

http://stackoverflow.com/questions/4279854/failing-to-test-sign-out-with-webrat-rails-with-authlogic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.