Skip to content

Commit

Permalink
Tweak signing out.
Browse files Browse the repository at this point in the history
* Rename route: /clear -> /signout
* Rename link: log out -> sign out
* Tweak flash message wording.
  • Loading branch information
twe4ked committed May 13, 2012
1 parent 2df98b0 commit 6ed1204
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions spec/integration/tmpfollow_spec.rb
Expand Up @@ -27,6 +27,12 @@
it 'shows the current username' do
page.should have_content '@nedstark'
end

it 'allows signing out' do
click_link 'sign out'
page.should have_content 'Signed out successfully.'
page.should have_content 'Authenticate with Twitter'
end
end

context 'with invalid credentials' do
Expand Down
4 changes: 2 additions & 2 deletions tmpfollow.rb
Expand Up @@ -108,11 +108,11 @@ def authenticated?
redirect to '/'
end

get '/clear' do
get '/signout' do
session[:oauth_token] = nil
session[:oauth_token_secret] = nil

flash[:alert] = 'Tokens cleared.'
flash[:alert] = 'Signed out successfully.'
redirect to '/'
end

Expand Down
2 changes: 1 addition & 1 deletion views/layout.haml
Expand Up @@ -12,7 +12,7 @@
= yield

- if authenticated?
%p.account Authenticated as @#{session[:username]} (#{"<a href='/clear'>log out</a>"}).
%p.account Authenticated as @#{session[:username]} (#{"<a href='/signout'>sign out</a>"}).

%footer
Made by Odin Dutton

0 comments on commit 6ed1204

Please sign in to comment.