diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-09-21 12:05:28 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-09-21 12:05:28 -0700 |
commit | 1bbb9b2db05730194edfd7d2cef9f5fcb9d79e50 (patch) | |
tree | 36201d3efb5af8ae5ec1898fd6f3b8b366227819 /actionpack/test/controller/caching_test.rb | |
parent | e2d0b0ee61c5a8c2626abb5ac1029b48ec1965eb (diff) | |
parent | 4215e9ab936efca915ca998273d2fc0c46bb59b8 (diff) | |
download | rails-1bbb9b2db05730194edfd7d2cef9f5fcb9d79e50.tar.gz rails-1bbb9b2db05730194edfd7d2cef9f5fcb9d79e50.tar.bz2 rails-1bbb9b2db05730194edfd7d2cef9f5fcb9d79e50.zip |
Merge commit 'jose/orchestra'
Diffstat (limited to 'actionpack/test/controller/caching_test.rb')
-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 |