1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Adding warden scopes to helper methods.

This commit is contained in:
Carlos A. da Silva 2009-10-10 16:47:11 -03:00
parent 4e263b96c9
commit 561833e060
4 changed files with 25 additions and 16 deletions

View file

@ -6,6 +6,10 @@ class MockController < ApplicationController
def request
self
end
def path
''
end
end
class ControllerAuthenticableTest < ActionController::TestCase
@ -29,6 +33,11 @@ class ControllerAuthenticableTest < ActionController::TestCase
@controller.authenticated?
end
test 'run authenticate? with scope on warden' do
@mock_warden.expects(:authenticated?).with(:my_scope).returns(true)
@controller.authenticated?(:my_scope)
end
test 'proxy logged_in? to authenticated' do
@mock_warden.expects(:authenticated?).returns(true)
@controller.logged_in?