From 55b6697493e2fc39f3e2a7b6b3c8bcfb94947daa Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 12 Nov 2007 15:02:12 +0000 Subject: Fixed that has_many :through associations should render as collections too (closes #9051) [mathie/danger] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8130 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../render_partial_with_record_identification_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test/activerecord') diff --git a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb b/actionpack/test/activerecord/render_partial_with_record_identification_test.rb index 7aeb1192f1..ccebbefead 100644 --- a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +++ b/actionpack/test/activerecord/render_partial_with_record_identification_test.rb @@ -14,6 +14,11 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase render :partial => @topic.replies end + def render_with_has_many_through_association + @developer = Developer.find(:first) + render :partial => @developer.topics + end + def render_with_belongs_to_association @reply = Reply.find(1) render :partial => @reply.topic @@ -47,6 +52,11 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase assert_template 'replies/_reply' end + def test_rendering_partial_with_has_many_association + get :render_with_has_many_through_association + assert_template 'topics/_topic' + end + def test_rendering_partial_with_belongs_to_association get :render_with_belongs_to_association assert_template 'topics/_topic' -- cgit v1.2.3