diff options
author | José Valim <jose.valim@gmail.com> | 2009-09-19 12:31:47 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-09-20 10:56:38 -0300 |
commit | 7cc1c2e71da1ad277acc7a7664321d2224a56bb8 (patch) | |
tree | 3a0aa4da485ebadb82f0e98d983994de02aa64f0 /actionpack/test/controller | |
parent | 8f47f311b7665d74220baf1449b39dc4e70e13e2 (diff) | |
download | rails-7cc1c2e71da1ad277acc7a7664321d2224a56bb8.tar.gz rails-7cc1c2e71da1ad277acc7a7664321d2224a56bb8.tar.bz2 rails-7cc1c2e71da1ad277acc7a7664321d2224a56bb8.zip |
Add Orchestra instrumentation to fragment and page caching.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 25e035cb49..bd17df73c7 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -625,15 +625,20 @@ class FragmentCachingTest < ActionController::TestCase def test_fragment_for_logging fragment_computed = false - @controller.class.expects(:benchmark).with('Cached fragment exists?: views/expensive') - @controller.class.expects(:benchmark).with('Cached fragment miss: views/expensive') - @controller.class.expects(:benchmark).with('Cached fragment hit: views/expensive').never + listener = [] + ActiveSupport::Orchestra.register listener buffer = 'generated till now -> ' @controller.fragment_for(buffer, 'expensive') { fragment_computed = true } + assert_equal 2, listener.size + assert_equal :fragment_exist?, listener[0].name + assert_equal :write_fragment, listener[1].name + assert fragment_computed assert_equal 'generated till now -> ', buffer + ensure + ActiveSupport::Orchestra.unregister listener end end |