class DynamicInheritedCallbacks
Public Instance Methods
test_callbacks_looks_to_the_superclass_before_running()
click to toggle source
# File activesupport/test/callback_inheritance_test.rb, line 165 def test_callbacks_looks_to_the_superclass_before_running child = EmptyChild.new.dispatch assert !child.performed? EmptyParent.set_callback :dispatch, :before, :perform! child = EmptyChild.new.dispatch assert child.performed? end
test_callbacks_should_be_performed_once_in_child_class()
click to toggle source
# File activesupport/test/callback_inheritance_test.rb, line 173 def test_callbacks_should_be_performed_once_in_child_class CountingParent.set_callback(:dispatch, :before) { count! } child = CountingChild.new.dispatch assert_equal 1, child.count end