From d9375f3f302a5d1856ad57946c7263d4e6a45a2a Mon Sep 17 00:00:00 2001 From: Carlhuda Date: Wed, 17 Mar 2010 16:28:05 -0700 Subject: Modify assert_template to use notifications. Also, remove ActionController::Base#template since it is no longer needed. --- actionpack/test/controller/render_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/test/controller/render_test.rb') diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 20fcb87da6..1d7692f0a8 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -418,7 +418,7 @@ class TestController < ActionController::Base def rendering_with_conflicting_local_vars @name = "David" - def @template.name() nil end + def view_context.name() nil end render :action => "potential_conflicts" end @@ -526,11 +526,11 @@ class TestController < ActionController::Base end def partial_with_form_builder - render :partial => ActionView::Helpers::FormBuilder.new(:post, nil, @template, {}, Proc.new {}) + render :partial => ActionView::Helpers::FormBuilder.new(:post, nil, view_context, {}, Proc.new {}) end def partial_with_form_builder_subclass - render :partial => LabellingFormBuilder.new(:post, nil, @template, {}, Proc.new {}) + render :partial => LabellingFormBuilder.new(:post, nil, view_context, {}, Proc.new {}) end def partial_collection -- cgit v1.2.3 From 71c9337f45f9c5461cbc6ddf6cab764ad0f82c3b Mon Sep 17 00:00:00 2001 From: Carlhuda Date: Thu, 18 Mar 2010 15:52:43 -0700 Subject: All tests pass without memoizing view_context --- actionpack/test/controller/render_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'actionpack/test/controller/render_test.rb') diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 1d7692f0a8..24817a93d2 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -18,6 +18,13 @@ class TestController < ActionController::Base layout :determine_layout + def name + nil + end + + private :name + helper_method :name + def hello_world end @@ -418,7 +425,6 @@ class TestController < ActionController::Base def rendering_with_conflicting_local_vars @name = "David" - def view_context.name() nil end render :action => "potential_conflicts" end -- cgit v1.2.3 From edb5991a14e0dfb65d2b8802d61b44fc47004921 Mon Sep 17 00:00:00 2001 From: Carlhuda Date: Thu, 18 Mar 2010 16:55:32 -0700 Subject: Make render :partial, :layout consistent between AC and AV --- actionpack/test/controller/render_test.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'actionpack/test/controller/render_test.rb') diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 24817a93d2..2f3997518f 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -513,10 +513,6 @@ class TestController < ActionController::Base end end - def partial_only_with_layout - render :partial => "partial_only", :layout => true - end - def render_to_string_with_partial @partial_only = render_to_string :partial => "partial_only" @partial_with_locals = render_to_string :partial => "customer", :locals => { :customer => Customer.new("david") } @@ -640,8 +636,7 @@ class TestController < ActionController::Base "rendering_nothing_on_layout", "render_text_hello_world", "render_text_hello_world_with_layout", "hello_world_with_layout_false", - "partial_only", "partial_only_with_layout", - "accessing_params_in_template", + "partial_only", "accessing_params_in_template", "accessing_params_in_template_with_layout", "render_with_explicit_template", "render_with_explicit_string_template", @@ -1204,11 +1199,6 @@ class RenderTest < ActionController::TestCase assert_equal 'partial html', @response.body end - def test_partial_only_with_layout - get :partial_only_with_layout - assert_equal "only partial", @response.body - end - def test_render_to_string_partial get :render_to_string_with_partial assert_equal "only partial", assigns(:partial_only) -- cgit v1.2.3