aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-07-26 18:57:02 +0200
committerXavier Noria <fxn@hashref.com>2010-07-26 18:57:02 +0200
commitb31c0ae306cf4357304fd7fe8130480f336590f9 (patch)
treed28f1c4611da7a9edd5d2ec56ddd03752efbc33e /activerecord/test
parent79f9fcd70d9c15f63f62fb04a46996ae29769937 (diff)
parentc819c131f2d08a8c9089a6ef0dcadcf912e2538c (diff)
downloadrails-b31c0ae306cf4357304fd7fe8130480f336590f9.tar.gz
rails-b31c0ae306cf4357304fd7fe8130480f336590f9.tar.bz2
rails-b31c0ae306cf4357304fd7fe8130480f336590f9.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/autosave_association_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb
index 3b89c12a3f..08694526af 100644
--- a/activerecord/test/cases/autosave_association_test.rb
+++ b/activerecord/test/cases/autosave_association_test.rb
@@ -171,7 +171,7 @@ class TestDefaultAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCas
end
class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::TestCase
- fixtures :companies
+ fixtures :companies, :posts, :tags, :taggings
def test_should_save_parent_but_not_invalid_child
client = Client.new(:name => 'Joe (the Plumber)')
@@ -312,6 +312,12 @@ class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::Test
assert_equal num_orders +1, Order.count
assert_equal num_customers +2, Customer.count
end
+
+ def test_store_association_with_a_polymorphic_relationship
+ num_tagging = Tagging.count
+ tags(:misc).create_tagging(:taggable => posts(:thinking))
+ assert_equal num_tagging +1, Tagging.count
+ end
end
class TestDefaultAutosaveAssociationOnAHasManyAssociation < ActiveRecord::TestCase