Skip to content

Commit

Permalink
Reset assert_template instance variables between requests [#5832 stat…
Browse files Browse the repository at this point in the history
…e:resolved]
  • Loading branch information
pixeltrix committed Oct 18, 2010
1 parent 7b2ec38 commit f757317
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions actionpack/lib/action_controller/test_case.rb
Expand Up @@ -40,6 +40,13 @@ def teardown_subscriptions
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
Expand Down
8 changes: 8 additions & 0 deletions actionpack/test/controller/action_pack_assertions_test.rb
Expand Up @@ -465,6 +465,14 @@ def test_fails_with_incorrect_symbol
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
Expand Down

0 comments on commit f757317

Please sign in to comment.