aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/notifications_test.rb
diff options
context:
space:
mode:
authorJustin George <justin.george@gmail.com>2010-04-27 14:13:47 -0700
committerJosé Valim <jose.valim@gmail.com>2010-05-02 22:45:53 +0200
commit109d3ee38d1c39f0e27bc827065427635d6396b2 (patch)
treed3acf513a62d3928e445fd79aa658fa2be56c461 /activesupport/test/notifications_test.rb
parent02028e529c97488b6c70cdbf66dc08c7fb2d36aa (diff)
downloadrails-109d3ee38d1c39f0e27bc827065427635d6396b2.tar.gz
rails-109d3ee38d1c39f0e27bc827065427635d6396b2.tar.bz2
rails-109d3ee38d1c39f0e27bc827065427635d6396b2.zip
Make notifications go off even when an error is raised, so that we capture the underlying performance data [#4505 state:resolved]
This is important when trying to keep track of many layers of interrelated calls i.e.: ActiveRecord::Base.transaction do MyModel.find(1) #ActiveRecord::NotFound end # should capture the full time until the error propagation Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport/test/notifications_test.rb')
-rw-r--r--activesupport/test/notifications_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb
index c2e1c588f0..251380a0d5 100644
--- a/activesupport/test/notifications_test.rb
+++ b/activesupport/test/notifications_test.rb
@@ -168,7 +168,7 @@ module Notifications
assert_equal Hash[:payload => "notifications"], @events.last.payload
end
- def test_instrument_does_not_publish_when_exception_is_raised
+ def test_instrument_publishes_when_exception_is_raised
begin
instrument(:awesome, :payload => "notifications") do
raise "FAIL"
@@ -178,7 +178,7 @@ module Notifications
end
drain
- assert_equal 0, @events.size
+ assert_equal 1, @events.size
end
def test_event_is_pushed_even_without_block