Permalink
Browse files

Always initialize @title in caching test to avoid uninitialized insta…

…nce variable warning
  • Loading branch information...
1 parent ddc584e commit 7b9f3eb10bc558ceb9942da2ee3daffe5c068316 @wycats wycats committed May 23, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 actionpack/test/controller/caching_test.rb
@@ -187,6 +187,9 @@ class ActionCachingTestController < CachingController
rescue_from(ActiveRecord::RecordNotFound) { head :not_found }
end
+ # Eliminate uninitialized ivar warning
+ before_filter { @title = nil }
+
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" }

0 comments on commit 7b9f3eb

Please sign in to comment.