aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_controller/test_case.rb7
-rw-r--r--actionpack/test/controller/action_pack_assertions_test.rb8
2 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index 6061945622..0c26071379 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -40,6 +40,13 @@ module ActionController
ActiveSupport::Notifications.unsubscribe("!render_template.action_view")
end
+ def process(*args)
+ @partials = Hash.new(0)
+ @templates = Hash.new(0)
+ @layouts = Hash.new(0)
+ super
+ end
+
# Asserts that the request was rendered with the appropriate template file or partials.
#
# ==== Examples
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb
index 5a8b763717..5a210aa9ec 100644
--- a/actionpack/test/controller/action_pack_assertions_test.rb
+++ b/actionpack/test/controller/action_pack_assertions_test.rb
@@ -465,6 +465,14 @@ class AssertTemplateTest < ActionController::TestCase
assert_template :hello_planet
end
end
+
+ def test_assert_template_reset_between_requests
+ get :hello_world
+ assert_template 'test/hello_world'
+
+ get :nothing
+ assert_template nil
+ end
end
class ActionPackHeaderTest < ActionController::TestCase