diff options
author | josevalim <jose.valim@gmail.com> | 2008-06-03 14:02:51 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-06-03 14:02:51 -0500 |
commit | d54d90f2b590c763fe710482a9b993923fe03ec0 (patch) | |
tree | 99b293aa7c115d9d083f6f42280d8438faa5fe4a /actionpack/test | |
parent | aa1771668877f20ca044e8f45a9736fbb7c8402e (diff) | |
download | rails-d54d90f2b590c763fe710482a9b993923fe03ec0.tar.gz rails-d54d90f2b590c763fe710482a9b993923fe03ec0.tar.bz2 rails-d54d90f2b590c763fe710482a9b993923fe03ec0.zip |
Allow caches_action to accept a layout option [#198 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index f9b6b87bc6..c6d61bb504 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -156,6 +156,7 @@ class ActionCachingTestController < ActionController::Base caches_action :show, :cache_path => 'http://test.host/custom/show' caches_action :edit, :cache_path => Proc.new { |c| c.params[:id] ? "http://test.host/#{c.params[:id]};edit" : "http://test.host/edit" } caches_action :with_layout + caches_action :layout_false, :layout => false layout 'talk_from_action.erb' @@ -181,6 +182,7 @@ class ActionCachingTestController < ActionController::Base alias_method :show, :index alias_method :edit, :index alias_method :destroy, :index + alias_method :layout_false, :with_layout def expire expire_action :controller => 'action_caching_test', :action => 'index' @@ -263,6 +265,19 @@ class ActionCacheTest < Test::Unit::TestCase assert_equal @response.body, read_fragment('hostname.com/action_caching_test/with_layout') end + def test_action_cache_with_layout_and_layout_cache_false + get :layout_false + cached_time = content_to_cache + assert_not_equal cached_time, @response.body + assert fragment_exist?('hostname.com/action_caching_test/layout_false') + reset! + + get :layout_false + assert_not_equal cached_time, @response.body + + assert_equal cached_time, read_fragment('hostname.com/action_caching_test/layout_false') + end + def test_action_cache_conditional_options @request.env['HTTP_ACCEPT'] = 'application/json' get :index |