aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-14 20:04:43 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-14 20:04:43 -0300
commitf2bff250a017b6da76b7587a164643db31ffbf9b (patch)
tree9eef138f7fae5c6c43cbbaa87e2097db168f7b11 /actionpack/test
parent125cc780c534b836f5443259991307e88b92ad1e (diff)
parent92fbbf67e339f24f9203d9927c028ee052685377 (diff)
downloadrails-f2bff250a017b6da76b7587a164643db31ffbf9b.tar.gz
rails-f2bff250a017b6da76b7587a164643db31ffbf9b.tar.bz2
rails-f2bff250a017b6da76b7587a164643db31ffbf9b.zip
Merge pull request #14137 from dasch/better-fragment-cache-instrumentation
Add controller and action name to the fragment caching instrumentation payload Conflicts: actionpack/CHANGELOG.md
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/caching_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 58a86ce9af..c0e6a2ebd1 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -227,6 +227,22 @@ CACHED
@store.read("views/test.host/functional_caching/inline_fragment_cached/#{template_digest("functional_caching/inline_fragment_cached")}"))
end
+ def test_fragment_cache_instrumentation
+ payload = nil
+
+ subscriber = proc do |*args|
+ event = ActiveSupport::Notifications::Event.new(*args)
+ payload = event.payload
+ end
+
+ ActiveSupport::Notifications.subscribed(subscriber, "read_fragment.action_controller") do
+ get :inline_fragment_cached
+ end
+
+ assert_equal "functional_caching", payload[:controller]
+ assert_equal "inline_fragment_cached", payload[:action]
+ end
+
def test_html_formatted_fragment_caching
get :formatted_fragment_cached, :format => "html"
assert_response :success