mirror of
				https://github.com/heartcombo/devise.git
				synced 2022-11-09 12:18:31 -05:00 
			
		
		
		
	add test for lazy loading hook
This commit is contained in:
		
							parent
							
								
									2bb8e1c236
								
							
						
					
					
						commit
						f220b992c3
					
				
					 3 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -337,4 +337,10 @@ class FailureTest < ActiveSupport::TestCase
 | 
			
		|||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  context "Lazy loading" do
 | 
			
		||||
    test "loads" do
 | 
			
		||||
      assert_equal Devise::FailureApp.new.lazy_loading_works?, "yes it does"
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -179,4 +179,9 @@ Devise.setup do |config|
 | 
			
		|||
  #   manager.failure_app = AnotherApp
 | 
			
		||||
  #   manager.default_strategies(scope: :user).unshift :some_external_strategy
 | 
			
		||||
  # end
 | 
			
		||||
 | 
			
		||||
  ActiveSupport.on_load(:devise_failure_app) do
 | 
			
		||||
    require "lazy_load_test_module"
 | 
			
		||||
    include LazyLoadTestModule
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										5
									
								
								test/rails_app/lib/lazy_load_test_module.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								test/rails_app/lib/lazy_load_test_module.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
module LazyLoadTestModule
 | 
			
		||||
  def lazy_loading_works?
 | 
			
		||||
    "yes it does"
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue