aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-17 11:17:42 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-17 11:29:51 +0100
commit0334f9f6cfa4c4c746de7e19250a13366b616c55 (patch)
tree9e2ff5d7efac90c26f3256d26d0789c14424ab7e /activesupport/test
parentafd0c06dfa8d3e04e85f9f0ea65c9beb376cb79f (diff)
downloadrails-0334f9f6cfa4c4c746de7e19250a13366b616c55.tar.gz
rails-0334f9f6cfa4c4c746de7e19250a13366b616c55.tar.bz2
rails-0334f9f6cfa4c4c746de7e19250a13366b616c55.zip
Add ActionDispatch::Notifications middleware.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/notifications_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb
index c3eb1a4eb5..c41d81fe7e 100644
--- a/activesupport/test/notifications_test.rb
+++ b/activesupport/test/notifications_test.rb
@@ -90,6 +90,22 @@ module Notifications
drain
end
+ def test_instrument_with_bang_returns_result_even_on_failure
+ begin
+ instrument!(:awesome, :payload => "notifications") do
+ raise "OMG"
+ end
+ flunk
+ rescue
+ end
+
+ drain
+
+ assert_equal 1, @events.size
+ assert_equal :awesome, @events.last.name
+ assert_equal Hash[:payload => "notifications"], @events.last.payload
+ end
+
def test_instrument_yields_the_paylod_for_further_modification
assert_equal 2, instrument(:awesome) { |p| p[:result] = 1 + 1 }
drain