From 6eee1dd62c85e23d84f16e8f300d8aba77bd5c64 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 14 Oct 2009 19:31:29 -0700 Subject: Clarify AR dependency --- actionpack/test/controller/caching_test.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'actionpack') diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 69b0eb5e3e..495b431307 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -149,7 +149,9 @@ end class ActionCachingTestController < ActionController::Base rescue_from(Exception) { head 500 } - rescue_from(ActiveRecord::RecordNotFound) { head :not_found } + if defined? ActiveRecord + rescue_from(ActiveRecord::RecordNotFound) { head :not_found } + end 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' @@ -474,11 +476,13 @@ class ActionCacheTest < ActionController::TestCase assert_response :success end - def test_record_not_found_returns_404_for_multiple_requests - get :record_not_found - assert_response 404 - get :record_not_found - assert_response 404 + if defined? ActiveRecord + def test_record_not_found_returns_404_for_multiple_requests + get :record_not_found + assert_response 404 + get :record_not_found + assert_response 404 + end end def test_four_oh_four_returns_404_for_multiple_requests -- cgit v1.2.3