From 9a70f0e317e62993337e3e47382dcb7795d65652 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 3 Sep 2013 10:49:00 +0200 Subject: Cleanup sessions controller - webapp logs in through the api. So the #create and #update actions were not needed anymore. Also removed the tests --- users/app/controllers/sessions_controller.rb | 10 ---------- users/test/functional/sessions_controller_test.rb | 21 --------------------- 2 files changed, 31 deletions(-) (limited to 'users') diff --git a/users/app/controllers/sessions_controller.rb b/users/app/controllers/sessions_controller.rb index d6c455b..0494b51 100644 --- a/users/app/controllers/sessions_controller.rb +++ b/users/app/controllers/sessions_controller.rb @@ -8,16 +8,6 @@ class SessionsController < ApplicationController end end - def create - logout if logged_in? - authenticate! - end - - def update - authenticate! - render :json => session.delete(:handshake) - end - def destroy logout redirect_to root_path diff --git a/users/test/functional/sessions_controller_test.rb b/users/test/functional/sessions_controller_test.rb index b22c3a3..a630e6e 100644 --- a/users/test/functional/sessions_controller_test.rb +++ b/users/test/functional/sessions_controller_test.rb @@ -41,27 +41,6 @@ class SessionsControllerTest < ActionController::TestCase assert_json_error :login => I18n.t(:all_strategies_failed) end - # Warden takes care of parsing the params and - # rendering the response. So not much to test here. - test "should perform handshake" do - request.env['warden'].expects(:authenticate!) - # make sure we don't get a template missing error: - @controller.stubs(:render) - post :create, :login => @user.login, 'A' => @client_hex - end - - test "should authorize" do - request.env['warden'].expects(:authenticate!) - handshake = stub(:to_json => "JSON") - session[:handshake] = handshake - - post :update, :id => @user.login, :client_auth => @client_hex - - assert_nil session[:handshake] - assert_response :success - assert_json_response handshake - end - test "logout should reset warden user" do expect_warden_logout delete :destroy -- cgit v1.2.3