From 0e0df4b0c5df7fdd1daa5653c255c4737f5526fc Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Wed, 23 Jun 2010 07:59:56 -0500 Subject: In ActionView::TestCase::Behavior, assign variables right before rendering the view. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Previously, _assigns were locked down the first time _view was referenced. [#4931 state:resolved] Signed-off-by: José Valim --- actionpack/test/template/test_case_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/test_case_test.rb b/actionpack/test/template/test_case_test.rb index d86dc7b185..4773eae039 100644 --- a/actionpack/test/template/test_case_test.rb +++ b/actionpack/test/template/test_case_test.rb @@ -200,6 +200,15 @@ module ActionView assert_match /Hello: EloyHello: Manfred/, render(:file => 'test/list') end + test "is able to render partials from templates and also use instance variables after _view has been referenced" do + @controller.controller_path = "test" + + _view + + @customers = [stub(:name => 'Eloy'), stub(:name => 'Manfred')] + assert_match /Hello: EloyHello: Manfred/, render(:file => 'test/list') + end + end class AssertionsTest < ActionView::TestCase -- cgit v1.2.3