Permalink
Browse files

Fixed global sign out; Fixed invalid controller test case;

* The cookie wasn't initalized correctly in the test's setup causing mistaken acceptance
* The order of remember token reset in relation to the cookie cleanup was backwards in the sign_out
  • Loading branch information...
1 parent 63e3225 commit 90cecbcc3815bba0e762de11b3f7ac66fa863fcd @rmm5t rmm5t committed Feb 19, 2010
Showing with 2 additions and 3 deletions.
  1. +1 −1 lib/clearance/authentication.rb
  2. +1 −2 test/controllers/sessions_controller_test.rb
@@ -75,8 +75,8 @@ def sign_in(user)
# @example
# sign_out
def sign_out
- cookies.delete(:remember_token)
current_user.reset_remember_token! if current_user
+ cookies.delete(:remember_token)
current_user = nil
end
@@ -123,8 +123,7 @@ class SessionsControllerTest < ActionController::TestCase
setup do
@user = Factory(:email_confirmed_user)
@user.update_attribute(:remember_token, "old-token")
- cookies['remember_token'] = CGI::Cookie.new('token', 'value')
- sign_in_as @user
+ @request.cookies["remember_token"] = "old-token"
delete :destroy
end

0 comments on commit 90cecbc

Please sign in to comment.