diff --git a/app/controllers/tokens_controller.rb b/app/controllers/tokens_controller.rb index f50f0bbf8..555f26246 100644 --- a/app/controllers/tokens_controller.rb +++ b/app/controllers/tokens_controller.rb @@ -1,9 +1,4 @@ class TokensController < ApplicationController - def create - current_user.reset_authentication_token! - current_user.authentication_token - redirect_to token_path, :notice => "Authentication token reset." - end def show end end diff --git a/config/routes.rb b/config/routes.rb index f6726bbfb..d3895c5b9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -69,7 +69,7 @@ Diaspora::Application.routes.draw do #Temporary token_authenticable route - resource :token, :only => [:show, :create] + resource :token, :only => :show get 'login' => redirect('/users/sign_in') diff --git a/spec/controllers/tokens_controller_spec.rb b/spec/controllers/tokens_controller_spec.rb index 3a18bdb19..c727f70a3 100644 --- a/spec/controllers/tokens_controller_spec.rb +++ b/spec/controllers/tokens_controller_spec.rb @@ -1,18 +1,9 @@ describe TokensController do - describe '#create' do - it 'generates a new token for the current user' do - sign_in bob - lambda { - get :create - }.should change{ bob.reload.authentication_token } - end - end - describe '#edit' do - it 'displays a token' do + describe '#show' do + it 'succeeds' do sign_in eve - get :create get :show - response.body.should include(eve.reload.authentication_token) + response.should be_success end end end