Skip to content

Instantly share code, notes, and snippets.

@mackato
Created May 24, 2010 18:22
Show Gist options
  • Save mackato/412229 to your computer and use it in GitHub Desktop.
Save mackato/412229 to your computer and use it in GitHub Desktop.
Fix controller spec errors
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/te
index 34499fa..aed493a 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -18,6 +18,7 @@ module ActionController
ActiveSupport::Notifications.subscribe("render_template.action_view") do |name, start, fi
path = payload[:layout]
+ @layouts ||= Hash.new(0)
@layouts[path] += 1
end
@@ -30,6 +31,7 @@ module ActionController
@partials[path.split("/").last] += 1
@templates[path] += 1
else
+ @templates ||= Hash.new(0)
@templates[path] += 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment