aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/custom_handler_test.rb6
-rw-r--r--actionpack/test/controller/layout_test.rb4
-rw-r--r--actionpack/test/controller/new_render_test.rb20
3 files changed, 24 insertions, 6 deletions
diff --git a/actionpack/test/controller/custom_handler_test.rb b/actionpack/test/controller/custom_handler_test.rb
index 932b8c15c3..cdde00cccc 100644
--- a/actionpack/test/controller/custom_handler_test.rb
+++ b/actionpack/test/controller/custom_handler_test.rb
@@ -5,9 +5,9 @@ class CustomHandler < ActionView::TemplateHandler
@view = view
end
- def render( template, local_assigns )
- [ template,
- local_assigns,
+ def render( template )
+ [ template.source,
+ template.locals,
@view ]
end
end
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb
index 11ad4a20af..56d7f69774 100644
--- a/actionpack/test/controller/layout_test.rb
+++ b/actionpack/test/controller/layout_test.rb
@@ -35,8 +35,8 @@ class MabView < ActionView::TemplateHandler
def initialize(view)
end
- def render(text, locals = {})
- text
+ def render(template)
+ template.source
end
end
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 928c46cb6d..0f14de54b1 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -146,6 +146,14 @@ class NewRenderTestController < ActionController::Base
def partial_collection
render :partial => "customer", :collection => [ Customer.new("david"), Customer.new("mary") ]
end
+
+ def partial_collection_with_spacer
+ render :partial => "customer", :spacer_template => "partial_only", :collection => [ Customer.new("david"), Customer.new("mary") ]
+ end
+
+ def partial_collection_with_counter
+ render :partial => "customer_counter", :collection => [ Customer.new("david"), Customer.new("mary") ]
+ end
def partial_collection_with_locals
render :partial => "customer_greeting", :collection => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" }
@@ -712,11 +720,21 @@ EOS
get :partial_collection
assert_equal "Hello: davidHello: mary", @response.body
end
-
+
+ def test_partial_collection_with_counter
+ get :partial_collection_with_counter
+ assert_equal "david1mary2", @response.body
+ end
+
def test_partial_collection_with_locals
get :partial_collection_with_locals
assert_equal "Bonjour: davidBonjour: mary", @response.body
end
+
+ def test_partial_collection_with_spacer
+ get :partial_collection_with_spacer
+ assert_equal "Hello: davidonly partialHello: mary", @response.body
+ end
def test_partial_collection_shorthand_with_locals
get :partial_collection_shorthand_with_locals