1
0
Fork 0
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:
Wolfram Nikolas Müller 2018-03-27 16:33:01 +02:00 committed by Leonardo Tegon
parent 2bb8e1c236
commit f220b992c3
3 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,5 @@
module LazyLoadTestModule
def lazy_loading_works?
"yes it does"
end
end