diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-09-22 15:08:45 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-09-22 15:08:45 -0300 |
commit | 5f9540e4830ace3459b4018006573bad7fb30b53 (patch) | |
tree | d8bdf97e712fec925bf6fe5ddccf4a7e9683c7a0 /actionpack/test/controller/caching_test.rb | |
parent | a294d8362bfb62b7133ad0799ae1327cd5ddd1e4 (diff) | |
parent | 24074796031d76d3ac2f5f0078d75699cce1bc54 (diff) | |
download | rails-5f9540e4830ace3459b4018006573bad7fb30b53.tar.gz rails-5f9540e4830ace3459b4018006573bad7fb30b53.tar.bz2 rails-5f9540e4830ace3459b4018006573bad7fb30b53.zip |
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/test/controller/caching_test.rb')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 25e035cb49..1a9f95e5e9 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -625,15 +625,19 @@ 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 1, listener.count { |e| e.name == :fragment_exist? } + assert_equal 1, listener.count { |e| e.name == :write_fragment } + assert fragment_computed assert_equal 'generated till now -> ', buffer + ensure + ActiveSupport::Orchestra.unregister listener end end |