aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRyan Wallace <rywall@gmail.com>2018-02-06 14:53:26 -0500
committerRyan Wallace <rywall@gmail.com>2018-02-06 16:05:39 -0500
commit56640b4de4e3245b087ca16e0f3bec751c6d6fb7 (patch)
treeaeeca67774cfc9068de83ee8f1b3265f7629995c /activesupport/test
parentd57c52a385eb57c6ce8c6d124ab5e186f931d142 (diff)
downloadrails-56640b4de4e3245b087ca16e0f3bec751c6d6fb7.tar.gz
rails-56640b4de4e3245b087ca16e0f3bec751c6d6fb7.tar.bz2
rails-56640b4de4e3245b087ca16e0f3bec751c6d6fb7.zip
Define callbacks on descendants.
We set callbacks on all descendants, so we need to make sure that they are also defined on all descendants as well.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/callback_inheritance_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/callback_inheritance_test.rb b/activesupport/test/callback_inheritance_test.rb
index 015e17deb9..5633b6e2b8 100644
--- a/activesupport/test/callback_inheritance_test.rb
+++ b/activesupport/test/callback_inheritance_test.rb
@@ -176,3 +176,13 @@ class DynamicInheritedCallbacks < ActiveSupport::TestCase
assert_equal 1, child.count
end
end
+
+class DynamicDefinedCallbacks < ActiveSupport::TestCase
+ def test_callbacks_should_be_performed_once_in_child_class_after_dynamic_define
+ GrandParent.define_callbacks(:foo)
+ GrandParent.set_callback(:foo, :before, :before1)
+ parent = Parent.new("foo")
+ parent.run_callbacks(:foo)
+ assert_equal %w(before1), parent.log
+ end
+end