diff options
Diffstat (limited to 'actionpack/test/activerecord')
-rw-r--r-- | actionpack/test/activerecord/render_partial_with_record_identification_test.rb | 14 |
1 files changed, 13 insertions, 1 deletions
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 94070f5523..32b26206c3 100644 --- a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +++ b/actionpack/test/activerecord/render_partial_with_record_identification_test.rb @@ -1,7 +1,7 @@ require 'active_record_unit' class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase - fixtures :developers, :projects, :developers_projects, :topics, :replies + fixtures :developers, :projects, :developers_projects, :topics, :replies, :companies, :mascots class RenderPartialWithRecordIdentificationController < ActionController::Base def render_with_has_many_and_belongs_to_association @@ -23,6 +23,11 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase render :partial => @developer.topics end + def render_with_has_one_association + @company = Company.find(1) + render :partial => @company.mascot + end + def render_with_belongs_to_association @reply = Reply.find(1) render :partial => @reply.topic @@ -71,4 +76,11 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase get :render_with_record_collection assert_template 'developers/_developer' end + + def test_rendering_partial_with_has_one_association + mascot = Company.find(1).mascot + get :render_with_has_one_association + assert_template 'mascots/_mascot' + assert_equal mascot.name, @response.body + end end |