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/controller/new_base/render_partial_test.rb

28 lines
724 B
Ruby
Raw Normal View History

2009-09-19 13:10:41 -04:00
require 'abstract_unit'
2009-05-14 18:30:35 -04:00
module RenderPartial
2009-05-14 18:30:35 -04:00
class BasicController < ActionController::Base
self.view_paths = [ActionView::FixtureResolver.new(
"render_partial/basic/_basic.html.erb" => "BasicPartial!",
2009-05-14 18:30:35 -04:00
"render_partial/basic/basic.html.erb" => "<%= @test_unchanged = 'goodbye' %><%= render :partial => 'basic' %><%= @test_unchanged %>"
)]
2009-05-14 18:30:35 -04:00
def changing
@test_unchanged = 'hello'
render :action => "basic"
end
2009-05-14 18:30:35 -04:00
end
class TestPartial < Rack::TestCase
2009-05-14 18:30:35 -04:00
testing BasicController
2009-05-14 18:30:35 -04:00
test "rendering a partial in ActionView doesn't pull the ivars again from the controller" do
get :changing
assert_response("goodbyeBasicPartial!goodbye")
2009-05-14 18:30:35 -04:00
end
end
end