aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/caching_test.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-05-04 19:23:34 -0300
committerEmilio Tagua <miloops@gmail.com>2009-05-04 19:23:34 -0300
commitd3042ef80c4406c90ff1e120059a99784d8ae79f (patch)
treea779b4fced3fd546d7c7c855fee41f3d996afba0 /actionpack/test/controller/caching_test.rb
parentd522b7ccf61a71b4c66ddf39368513d1fd9cd577 (diff)
parenteb201e64c0b68aee6d0715d44cf48178204c4133 (diff)
downloadrails-d3042ef80c4406c90ff1e120059a99784d8ae79f.tar.gz
rails-d3042ef80c4406c90ff1e120059a99784d8ae79f.tar.bz2
rails-d3042ef80c4406c90ff1e120059a99784d8ae79f.zip
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/test/controller/caching_test.rb')
-rw-r--r--actionpack/test/controller/caching_test.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 10b904481d..560c09509b 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -111,7 +111,7 @@ class PageCachingTest < ActionController::TestCase
end
def test_should_cache_ok_at_custom_path
- @request.stubs(:path).returns("/index.html")
+ @request.request_uri = "/index.html"
get :ok
assert_response :ok
assert File.exist?("#{FILE_STORE_PATH}/index.html")
@@ -149,6 +149,9 @@ class PageCachingTest < ActionController::TestCase
end
class ActionCachingTestController < ActionController::Base
+ rescue_from(Exception) { head 500 }
+ rescue_from(ActiveRecord::RecordNotFound) { head :not_found }
+
caches_action :index, :redirected, :forbidden, :if => Proc.new { |c| !c.request.format.json? }, :expires_in => 1.hour
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" }