diff options
author | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-07-20 22:51:39 +0800 |
---|---|---|
committer | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-07-21 08:47:26 +0800 |
commit | d14f64699715d24a7ceb33e6ef8fa14127716c24 (patch) | |
tree | 61e753f69ed11de0d437fb209d3ef665ac1728cf /actionpack/lib/action_controller | |
parent | 08754f12e65a9ec79633a605e986d0f1ffa4b251 (diff) | |
download | rails-d14f64699715d24a7ceb33e6ef8fa14127716c24.tar.gz rails-d14f64699715d24a7ceb33e6ef8fa14127716c24.tar.bz2 rails-d14f64699715d24a7ceb33e6ef8fa14127716c24.zip |
Fix AC::TemplateAssertions instance variables not resetting.
Fixes https://github.com/rails/rails/issues/16119.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index a18c35e3e9..657924a16c 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -13,10 +13,7 @@ module ActionController end def setup_subscriptions - @_partials = Hash.new(0) - @_templates = Hash.new(0) - @_layouts = Hash.new(0) - @_files = Hash.new(0) + reset_template_assertion @_subscribers = [] @_subscribers << ActiveSupport::Notifications.subscribe("render_template.action_view") do |_name, _start, _finish, _id, payload| @@ -56,10 +53,15 @@ module ActionController end def process(*args) + reset_template_assertion + super + end + + def reset_template_assertion @_partials = Hash.new(0) @_templates = Hash.new(0) @_layouts = Hash.new(0) - super + @_files = Hash.new(0) end # Asserts that the request was rendered with the appropriate template file or partials. |