aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorDavid Chelimsky <dchelimsky@gmail.com>2010-06-23 07:59:56 -0500
committerJosé Valim <jose.valim@gmail.com>2010-06-23 15:07:44 +0200
commit0e0df4b0c5df7fdd1daa5653c255c4737f5526fc (patch)
tree76d9f89cdfc19949736f744af0ef7a9dfe9f2720 /actionpack/test/template
parente8c064bbe0fb5e07c7ceaa45d0cafa3c4ef01ab0 (diff)
downloadrails-0e0df4b0c5df7fdd1daa5653c255c4737f5526fc.tar.gz
rails-0e0df4b0c5df7fdd1daa5653c255c4737f5526fc.tar.bz2
rails-0e0df4b0c5df7fdd1daa5653c255c4737f5526fc.zip
In ActionView::TestCase::Behavior, assign variables right before
rendering the view. - Previously, _assigns were locked down the first time _view was referenced. [#4931 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/test_case_test.rb9
1 files changed, 9 insertions, 0 deletions
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