diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-03 20:39:42 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-03 20:39:42 +0100 |
commit | 6fbe9ef2ffb1858027130789246f3ae24a0a182f (patch) | |
tree | 6926a804d3b78021e421470518bf10d2ca919ef9 /actionpack/test/controller/caching_test.rb | |
parent | 4796be33a464a4587d0e22dfef113aca597c91c4 (diff) | |
download | rails-6fbe9ef2ffb1858027130789246f3ae24a0a182f.tar.gz rails-6fbe9ef2ffb1858027130789246f3ae24a0a182f.tar.bz2 rails-6fbe9ef2ffb1858027130789246f3ae24a0a182f.zip |
Use namespaces in notifications.
Diffstat (limited to 'actionpack/test/controller/caching_test.rb')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 679eaf7b38..54d1a72f1f 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -630,17 +630,15 @@ class FragmentCachingTest < ActionController::TestCase end def test_fragment_for_logging - fragment_computed = false - events = [] - ActiveSupport::Notifications.subscribe { |*args| events << args } + @controller.logger = MockLogger.new - buffer = 'generated till now -> ' - @controller.fragment_for(buffer, 'expensive') { fragment_computed = true } + fragment_computed = false + @controller.fragment_for('buffer', 'expensive') { fragment_computed = true } + ActiveSupport::Notifications.notifier.wait assert fragment_computed - assert_equal 'generated till now -> ', buffer - ActiveSupport::Notifications.notifier.wait - assert_equal [:exist_fragment?, :write_fragment], events.map(&:first) + assert_match /Exist fragment\? "views\/expensive"/, @controller.logger.logged[0] + assert_match /Write fragment "views\/expensive"/, @controller.logger.logged[1] end end |