1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/new_base/render_partial_test.rb
2009-05-14 15:30:35 -07:00

27 lines
No EOL
785 B
Ruby

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