diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-14 15:30:35 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-14 15:30:35 -0700 |
commit | 8fac2c88cae0f2fd42fad3c2c2c6c860df14d629 (patch) | |
tree | d959ad5fa6cf72cc8c887cdf1ebdfe2ddea94bc4 /actionpack/test/new_base/render_partial_test.rb | |
parent | 49a84ff69ca4fc4db821ca3b5a5926d07832c845 (diff) | |
download | rails-8fac2c88cae0f2fd42fad3c2c2c6c860df14d629.tar.gz rails-8fac2c88cae0f2fd42fad3c2c2c6c860df14d629.tar.bz2 rails-8fac2c88cae0f2fd42fad3c2c2c6c860df14d629.zip |
Cleaning up more render tests
Diffstat (limited to 'actionpack/test/new_base/render_partial_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_partial_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/actionpack/test/new_base/render_partial_test.rb b/actionpack/test/new_base/render_partial_test.rb new file mode 100644 index 0000000000..3a300afe5c --- /dev/null +++ b/actionpack/test/new_base/render_partial_test.rb @@ -0,0 +1,27 @@ +require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") + +module RenderPartial + + class BasicController < ActionController::Base + + self.view_paths = [ActionView::Template::FixturePath.new( + "render_partial/basic/_basic.html.erb" => "OMG!", + "render_partial/basic/basic.html.erb" => "<%= @test_unchanged = 'goodbye' %><%= render :partial => 'basic' %><%= @test_unchanged %>" + )] + + def changing + @test_unchanged = 'hello' + render :action => "basic" + end + end + + class TestPartial < SimpleRouteCase + testing BasicController + + test "rendering a partial in ActionView doesn't pull the ivars again from the controller" do + get :changing + assert_response("goodbyeOMG!goodbye") + end + end + +end
\ No newline at end of file |