From ed9567401dfc7b476bf9ccac82826fc63283f708 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 8 Oct 2012 22:22:47 +0200 Subject: recognizes when a partial was rendered twice. Closes #3675 --- actionpack/lib/action_view/test_case.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 5434b3421e..6e5a3a63ca 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -120,7 +120,7 @@ module ActionView end def locals - @locals ||= {} + @_locals ||= {} end included do @@ -162,12 +162,15 @@ module ActionView case options when Hash if block_given? - locals[options[:layout]] = options[:locals] + locals[options[:layout]] ||= [] + locals[options[:layout]] << options[:locals] elsif options.key?(:partial) - locals[options[:partial]] = options[:locals] + locals[options[:partial]] ||= [] + locals[options[:partial]] << options[:locals] end else - locals[options] = local_assigns + locals[options] ||= [] + locals[options] << local_assigns end super @@ -197,7 +200,7 @@ module ActionView :@_routes, :@controller, :@_layouts, - :@locals, + :@_locals, :@method_name, :@output_buffer, :@_partials, -- cgit v1.2.3