Sha256: b55e43ea281c2fade2d1e5dfeb6213d3a936b3870ab17c850c3ab7e033fdbae4

Contents?: true

Size: 504 Bytes

Versions: 12

Compression:

Stored size: 504 Bytes

Contents

require 'test_helper'

class LoadHooksControllerTest < ActionController::TestCase
  setup do
    ActiveSupport.on_load(:devise_controller) do
      define_method :defined_by_load_hook do
        puts 'I am defined dynamically by activesupport load hook'
      end
    end
  end

  teardown do
    DeviseController.class_eval { undef :defined_by_load_hook }
  end

  test 'load hook called when controller is loaded' do
    assert DeviseController.instance_methods.include? :defined_by_load_hook
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
devise-3.5.10 test/controllers/load_hooks_controller_test.rb
devise-3.5.9 test/controllers/load_hooks_controller_test.rb
devise-3.5.8 test/controllers/load_hooks_controller_test.rb
devise-3.5.7 test/controllers/load_hooks_controller_test.rb
devise-3.5.6 test/controllers/load_hooks_controller_test.rb
devise-3.5.5 test/controllers/load_hooks_controller_test.rb
devise-3.5.4 test/controllers/load_hooks_controller_test.rb
devise-3.5.3 test/controllers/load_hooks_controller_test.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/devise-3.5.2/test/controllers/load_hooks_controller_test.rb
devise-3.5.2 test/controllers/load_hooks_controller_test.rb
devise-3.5.1 test/controllers/load_hooks_controller_test.rb
deviseOne-1.0.0 test/controllers/load_hooks_controller_test.rb