Skip to content

Commit

Permalink
Clear cookies as well as session in UserSessionsController#destroy. F…
Browse files Browse the repository at this point in the history
…ixes #1257.
  • Loading branch information
radar committed Mar 12, 2012
1 parent 9615fd1 commit 803c5ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions auth/app/controllers/spree/user_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def create
end

def destroy
cookies.clear
session.clear
super
end
Expand Down
15 changes: 13 additions & 2 deletions auth/spec/requests/sign_out_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
require 'spec_helper'

describe "Sign Out" do
it "should allow a signed in user to logout" do
user = Factory(:user, :email => "email@person.com", :password => "secret", :password_confirmation => "secret")
let!(:user) do
Factory(:user,
:email => "email@person.com",
:password => "secret",
:password_confirmation => "secret")
end

before do
visit spree.login_path
fill_in "user_email", :with => user.email
fill_in "user_password", :with => user.password
# Regression test for #1257
check "Remember me"
click_button "Login"
end

it "should allow a signed in user to logout" do
click_link "Logout"
visit spree.root_path
page.should have_content("Login")
Expand Down

0 comments on commit 803c5ed

Please sign in to comment.