diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2010-03-07 21:53:21 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-09 00:11:34 +0100 |
commit | 47d252f9928568620844edce2161acd457c352c0 (patch) | |
tree | d8dce8dbd2c2c973bd792a51dafbc9d0c430a1c3 /activerecord/test/cases/associations/has_many_associations_test.rb | |
parent | 8e9d9232b0c3d96c662762e13848c275a86c0c61 (diff) | |
download | rails-47d252f9928568620844edce2161acd457c352c0.tar.gz rails-47d252f9928568620844edce2161acd457c352c0.tar.bz2 rails-47d252f9928568620844edce2161acd457c352c0.zip |
Fix associations to call :destroy or :delete based on the right :dependent option
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index ce7eedbb54..54624e79ce 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -14,7 +14,7 @@ require 'models/tagging' class HasManyAssociationsTest < ActiveRecord::TestCase fixtures :accounts, :categories, :companies, :developers, :projects, - :developers_projects, :topics, :authors, :comments, :author_addresses, + :developers_projects, :topics, :authors, :comments, :people, :posts, :readers, :taggings def setup @@ -684,24 +684,6 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal 'Microsoft', another_ms_client.name end - def test_dependent_delete_and_destroy_with_belongs_to - author_address = author_addresses(:david_address) - assert_equal [], AuthorAddress.destroyed_author_address_ids[authors(:david).id] - - assert_difference "AuthorAddress.count", -2 do - authors(:david).destroy - end - - assert_equal nil, AuthorAddress.find_by_id(authors(:david).author_address_id) - assert_equal nil, AuthorAddress.find_by_id(authors(:david).author_address_extra_id) - end - - def test_invalid_belongs_to_dependent_option_raises_exception - assert_raise ArgumentError do - Author.belongs_to :special_author_address, :dependent => :nullify - end - end - def test_clearing_without_initial_access firm = companies(:first_firm) |