mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Updating helpers to use sign_in/sign_out instead of authenticate/logout.
This commit is contained in:
@@ -31,7 +31,7 @@ class ControllerAuthenticableTest < ActionController::TestCase
|
||||
|
||||
test 'run authenticate? with scope on warden' do
|
||||
@mock_warden.expects(:authenticated?).with(:my_scope)
|
||||
@controller.authenticated?(:my_scope)
|
||||
@controller.signed_in?(:my_scope)
|
||||
end
|
||||
|
||||
test 'proxy signed_in? to authenticated' do
|
||||
@@ -49,27 +49,27 @@ class ControllerAuthenticableTest < ActionController::TestCase
|
||||
|
||||
test 'proxy logout to warden' do
|
||||
@mock_warden.expects(:logout).with(:user).returns(true)
|
||||
@controller.logout(:user)
|
||||
@controller.sign_out(:user)
|
||||
end
|
||||
|
||||
test 'proxy user_authenticate! to authenticate with user scope' do
|
||||
@mock_warden.expects(:authenticate!).with(:scope => :user)
|
||||
@controller.user_authenticate!
|
||||
@controller.sign_in_user!
|
||||
end
|
||||
|
||||
test 'proxy admin_authenticate! to authenticate with admin scope' do
|
||||
@mock_warden.expects(:authenticate!).with(:scope => :admin)
|
||||
@controller.admin_authenticate!
|
||||
@controller.sign_in_admin!
|
||||
end
|
||||
|
||||
test 'proxy user_authenticated? to authenticate with user scope' do
|
||||
@mock_warden.expects(:authenticated?).with(:user)
|
||||
@controller.user_authenticated?
|
||||
@controller.user_signed_in?
|
||||
end
|
||||
|
||||
test 'proxy admin_authenticated? to authenticate with admin scope' do
|
||||
@mock_warden.expects(:authenticated?).with(:admin)
|
||||
@controller.admin_authenticated?
|
||||
@controller.admin_signed_in?
|
||||
end
|
||||
|
||||
test 'require no authentication tests current mapping' do
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class AdminsController < ApplicationController
|
||||
before_filter :admin_authenticate!
|
||||
before_filter :sign_in_admin!
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class UsersController < ApplicationController
|
||||
before_filter :user_authenticate!
|
||||
before_filter :sign_in_user!
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user