diff options
Diffstat (limited to 'activerecord/test/associations_join_model_test.rb')
-rw-r--r-- | activerecord/test/associations_join_model_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/test/associations_join_model_test.rb b/activerecord/test/associations_join_model_test.rb index 2d74895664..58208ced65 100644 --- a/activerecord/test/associations_join_model_test.rb +++ b/activerecord/test/associations_join_model_test.rb @@ -38,7 +38,15 @@ class AssociationsJoinModelTest < Test::Unit::TestCase def test_polymorphic_has_many_going_through_join_model assert_equal tags(:general), posts(:welcome).tags.first end - + + def test_polymorphic_has_many_create_model_with_inheritance_and_custom_base_class + post = SubStiPost.create :title => 'SubStiPost', :body => 'SubStiPost body' + assert_instance_of SubStiPost, post + + tagging = tags(:misc).taggings.create(:taggable => post) + assert_equal "SubStiPost", tagging.taggable_type + end + def test_polymorphic_has_many_going_through_join_model_with_inheritance assert_equal tags(:general), posts(:thinking).tags.first end |