aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-06 13:40:21 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-06 13:40:21 +0000
commit7267db58906434da54e0f50122b5e8b704b1c953 (patch)
tree089ebe97424e2fab2630f629c7a5af1a21d72057 /activerecord/test/associations_test.rb
parent838ae35d63c34872d46bee8b006796ebdd9c7722 (diff)
downloadrails-7267db58906434da54e0f50122b5e8b704b1c953.tar.gz
rails-7267db58906434da54e0f50122b5e8b704b1c953.tar.bz2
rails-7267db58906434da54e0f50122b5e8b704b1c953.zip
Added destruction of dependent objects in has_one associations when a new assignment happens #742 [mindel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-xactiverecord/test/associations_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb
index 4a2779227d..b35aadf4ff 100755
--- a/activerecord/test/associations_test.rb
+++ b/activerecord/test/associations_test.rb
@@ -94,7 +94,8 @@ class HasOneAssociationsTest < Test::Unit::TestCase
@signals37.account = nil
@signals37.save
assert_nil @signals37.account
- assert_nil Account.find(old_account_id).firm_id
+ # account is dependent, therefore is destroyed when reference to owner is lost
+ assert_raises(ActiveRecord::RecordNotFound) { Account.find(old_account_id) }
end
def test_dependence