Methods
- S
- T
-
- test_expire_fragment_with_regexp,
- test_expire_fragment_with_simple_key,
- test_fragment_cache_key,
- test_fragment_exist_with_caching_disabled,
- test_fragment_exist_with_caching_enabled,
- test_fragment_for,
- test_html_safety,
- test_read_fragment_with_caching_disabled,
- test_read_fragment_with_caching_enabled,
- test_write_fragment_with_caching_disabled,
- test_write_fragment_with_caching_enabled
Instance Public methods
setup()
Link
# File actionpack/test/controller/caching_test.rb, line 46 def setup super @store = ActiveSupport::Cache::MemoryStore.new @controller = FragmentCachingTestController.new @controller.perform_caching = true @controller.cache_store = @store @params = {:controller => 'posts', :action => 'index'} @controller.params = @params @controller.request = @request @controller.response = @response end
test_expire_fragment_with_regexp()
Link
# File actionmailer/test/caching_test.rb, line 74 def test_expire_fragment_with_regexp @store.write('views/name', 'value') @store.write('views/another_name', 'another_value') @store.write('views/primalgrasp', 'will not expire ;-)') @mailer.expire_fragment(/name/) assert_nil @store.read('views/name') assert_nil @store.read('views/another_name') assert_equal 'will not expire ;-)', @store.read('views/primalgrasp') end
test_expire_fragment_with_simple_key()
Link
test_fragment_cache_key()
Link
# File actionpack/test/controller/caching_test.rb, line 58 def test_fragment_cache_key assert_equal 'views/what a key', @controller.fragment_cache_key('what a key') assert_equal "views/test.host/fragment_caching_test/some_action", @controller.fragment_cache_key(:controller => 'fragment_caching_test',:action => 'some_action') end
test_fragment_exist_with_caching_disabled()
Link
test_fragment_exist_with_caching_enabled()
Link
test_fragment_for()
Link
# File actionmailer/test/caching_test.rb, line 86 def test_fragment_for @store.write('views/expensive', 'fragment content') fragment_computed = false view_context = @mailer.view_context buffer = 'generated till now -> '.html_safe buffer << view_context.send(:fragment_for, 'expensive') { fragment_computed = true } assert !fragment_computed assert_equal 'generated till now -> fragment content', buffer end
test_html_safety()
Link
# File actionmailer/test/caching_test.rb, line 99 def test_html_safety assert_nil @store.read('views/name') content = 'value'.html_safe assert_equal content, @mailer.write_fragment('name', content) cached = @store.read('views/name') assert_equal content, cached assert_equal String, cached.class html_safe = @mailer.read_fragment('name') assert_equal content, html_safe assert html_safe.html_safe? end
test_read_fragment_with_caching_disabled()
Link
test_read_fragment_with_caching_enabled()
Link
test_write_fragment_with_caching_disabled()
Link
test_write_fragment_with_caching_enabled()
Link