aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJeff Kreeftmeijer <jeff@kreeftmeijer.nl>2010-05-15 13:25:48 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2010-05-15 10:32:23 -0700
commitfa99de0bd054576336c940ca78f3d1b35b6e490e (patch)
treeb6e89f15b73624e6bf93f01bc4c24b909e2cdbb7 /actionpack/test
parent3436fdfc12d58925e3d981e0afa61084ea34736c (diff)
downloadrails-fa99de0bd054576336c940ca78f3d1b35b6e490e.tar.gz
rails-fa99de0bd054576336c940ca78f3d1b35b6e490e.tar.bz2
rails-fa99de0bd054576336c940ca78f3d1b35b6e490e.zip
partial counters with :as [#2804 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/render_test.rb9
-rw-r--r--actionpack/test/fixtures/test/_customer_counter_with_as.erb1
2 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 2f3997518f..180d5e1a65 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -547,6 +547,10 @@ class TestController < ActionController::Base
render :partial => "customer_counter", :collection => [ Customer.new("david"), Customer.new("mary") ]
end
+ def partial_collection_with_as_and_counter
+ render :partial => "customer_counter_with_as", :collection => [ Customer.new("david"), Customer.new("mary") ], :as => :client
+ end
+
def partial_collection_with_locals
render :partial => "customer_greeting", :collection => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" }
end
@@ -1242,6 +1246,11 @@ class RenderTest < ActionController::TestCase
assert_equal "david0mary1", @response.body
end
+ def test_partial_collection_with_as_and_counter
+ get :partial_collection_with_as_and_counter
+ assert_equal "david0mary1", @response.body
+ end
+
def test_partial_collection_with_locals
get :partial_collection_with_locals
assert_equal "Bonjour: davidBonjour: mary", @response.body
diff --git a/actionpack/test/fixtures/test/_customer_counter_with_as.erb b/actionpack/test/fixtures/test/_customer_counter_with_as.erb
new file mode 100644
index 0000000000..1241eb604d
--- /dev/null
+++ b/actionpack/test/fixtures/test/_customer_counter_with_as.erb
@@ -0,0 +1 @@
+<%= client.name %><%= client_counter %> \ No newline at end of file