Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed logout issue

  • Loading branch information...
commit 0ba295930973888134368e8a4b00a46d6caf7f6d 1 parent ce989ee
@felipeelias authored
Showing with 17 additions and 1 deletion.
  1. +4 −1 application.rb
  2. +13 −0 spec/application_spec.rb
View
5 application.rb
@@ -73,7 +73,10 @@ def authorized?
end
get '/logout' do
- session[:current_user] = nil
+ [:access_token, :access_secret].each do |sess|
+ session[sess] = nil
+ end
+
redirect '/'
end
View
13 spec/application_spec.rb
@@ -57,4 +57,17 @@ def app
last_response.should_not be_redirect
end
end
+
+ describe "/logout" do
+ before do
+ session[:access_token] = 'token'
+ session[:access_secret] = 'secret'
+ end
+
+ it "should logout the user" do
+ get '/logout'
+ session[:access_token].should be_nil
+ session[:access_secret].should be_nil
+ end
+ end
end

0 comments on commit 0ba2959

Please sign in to comment.
Something went wrong with that request. Please try again.