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:
		
							parent
							
								
									4e263b96c9
								
							
						
					
					
						commit
						561833e060
					
				
					 4 changed files with 25 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -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?
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue