mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-22 21:28:01 -05:00
Use signed_in instead of logged_in, and setup current_user to pass a scope.
This commit is contained in:
@@ -38,24 +38,24 @@ class ControllerAuthenticableTest < ActionController::TestCase
|
||||
@controller.authenticated?(:my_scope)
|
||||
end
|
||||
|
||||
test 'proxy logged_in? to authenticated' do
|
||||
test 'proxy signed_in? to authenticated' do
|
||||
@mock_warden.expects(:authenticated?).with(:my_scope)
|
||||
@controller.logged_in?(:my_scope)
|
||||
@controller.signed_in?(:my_scope)
|
||||
end
|
||||
|
||||
test 'run user on warden' do
|
||||
@mock_warden.expects(:user).returns(true)
|
||||
@controller.user
|
||||
@controller.current_user
|
||||
end
|
||||
|
||||
test 'run current_user on warden' do
|
||||
@mock_warden.expects(:user).returns(true)
|
||||
@controller.current_user
|
||||
test 'run user with scope on warden' do
|
||||
@mock_warden.expects(:user).with(:admin).returns(true)
|
||||
@controller.current_user(:admin)
|
||||
end
|
||||
|
||||
test 'set the user on warden' do
|
||||
@mock_warden.expects(:set_user).returns(true)
|
||||
@controller.user = User.new
|
||||
@controller.current_user = User.new
|
||||
end
|
||||
|
||||
test 'proxy logout to warden' do
|
||||
|
||||
Reference in New Issue
Block a user