aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorタコ焼き仮面 <takoyakikamen0@gmail.com>2012-06-18 16:34:23 -0700
committerタコ焼き仮面 <takoyakikamen0@gmail.com>2012-06-18 16:34:23 -0700
commitc6d86a5db4b115783675c23900ddb292a44d99cc (patch)
treedec34597b5974a592a18d0c0aa5a8457fff51e17 /activesupport/test
parent7fe0f27e2b97a2f175b31b97d14f92473688f66a (diff)
downloadrails-c6d86a5db4b115783675c23900ddb292a44d99cc.tar.gz
rails-c6d86a5db4b115783675c23900ddb292a44d99cc.tar.bz2
rails-c6d86a5db4b115783675c23900ddb292a44d99cc.zip
make events not use date and time to determine parent_of. fixes #5932
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/notifications_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb
index fc9fa90d07..bcb393c7bc 100644
--- a/activesupport/test/notifications_test.rb
+++ b/activesupport/test/notifications_test.rb
@@ -221,13 +221,15 @@ module Notifications
assert_equal Hash[:payload => :bar], event.payload
end
- def test_event_is_parent_based_on_time_frame
+ def test_event_is_parent_based_on_children
time = Time.utc(2009, 01, 01, 0, 0, 1)
parent = event(:foo, Time.utc(2009), Time.utc(2009) + 100, random_id, {})
child = event(:foo, time, time + 10, random_id, {})
not_child = event(:foo, time, time + 100, random_id, {})
+ parent.children << child
+
assert parent.parent_of?(child)
assert !child.parent_of?(parent)
assert !parent.parent_of?(not_child)