diff options
author | Tobias Lütke <tobias.luetke@gmail.com> | 2005-10-15 00:46:55 +0000 |
---|---|---|
committer | Tobias Lütke <tobias.luetke@gmail.com> | 2005-10-15 00:46:55 +0000 |
commit | 70869931611667d5b732ae91704313115e4baa10 (patch) | |
tree | 27e1df63f6953b9a8484aaa1859152fa0fb2490e /activerecord/test/deprecated_associations_test.rb | |
parent | 64fcb752f2c2f337918f74cd0cc6049a4cafb7a6 (diff) | |
download | rails-70869931611667d5b732ae91704313115e4baa10.tar.gz rails-70869931611667d5b732ae91704313115e4baa10.tar.bz2 rails-70869931611667d5b732ae91704313115e4baa10.zip |
Adds :nullify option to :depends. Closes #2015 (Robby Russell)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/deprecated_associations_test.rb')
-rwxr-xr-x | activerecord/test/deprecated_associations_test.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/activerecord/test/deprecated_associations_test.rb b/activerecord/test/deprecated_associations_test.rb index 1d5908d774..d96a587dc0 100755 --- a/activerecord/test/deprecated_associations_test.rb +++ b/activerecord/test/deprecated_associations_test.rb @@ -79,10 +79,11 @@ class DeprecatedAssociationsTest < Test::Unit::TestCase end def test_has_one_dependence + num_accounts = Account.count firm = Firm.find(1) assert firm.has_account? - firm.destroy - assert_equal 1, Account.find_all.length + firm.destroy + assert_equal num_accounts - 1, Account.count end def test_has_one_dependence_with_missing_association @@ -124,10 +125,10 @@ class DeprecatedAssociationsTest < Test::Unit::TestCase assert !Account.find(2).firm?(companies(:first_firm)), "Unknown isn't linked" end - def test_has_many_dependence_on_account - assert_equal 2, Account.find_all.length + def test_has_many_dependence_on_account + num_accounts = Account.count companies(:first_firm).destroy - assert_equal 1, Account.find_all.length + assert_equal num_accounts - 1, Account.count end def test_find_in |