aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/deprecated_associations_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-12 05:34:10 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-12 05:34:10 +0000
commit3b9e90a4dab94d25bfa7ed5e47ca0641857ef992 (patch)
tree1bd1c5d02280f93c447d1917da98cbbdf9ab31a8 /activerecord/test/deprecated_associations_test.rb
parentb59619600fbbfb2cf6d7156fb4c21bb2c0cec955 (diff)
downloadrails-3b9e90a4dab94d25bfa7ed5e47ca0641857ef992.tar.gz
rails-3b9e90a4dab94d25bfa7ed5e47ca0641857ef992.tar.bz2
rails-3b9e90a4dab94d25bfa7ed5e47ca0641857ef992.zip
Moved build_association and create_association for has_one and belongs_to out of deprecation as they work when the association is nil unlike association.build and association.create, which require the association to be already in place #864
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1146 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/deprecated_associations_test.rb')
-rwxr-xr-xactiverecord/test/deprecated_associations_test.rb24
1 files changed, 0 insertions, 24 deletions
diff --git a/activerecord/test/deprecated_associations_test.rb b/activerecord/test/deprecated_associations_test.rb
index 49387ec8dc..4c2c62b8bd 100755
--- a/activerecord/test/deprecated_associations_test.rb
+++ b/activerecord/test/deprecated_associations_test.rb
@@ -174,30 +174,6 @@ class DeprecatedAssociationsTest < Test::Unit::TestCase
assert_equal @signals37.create_in_clients_of_firm("name" => "Another Client"), @signals37.clients_of_firm(true).last
end
- def test_succesful_build_association
- firm = Firm.new("name" => "GlobalMegaCorp")
- firm.save
-
- account = firm.build_account("credit_limit" => 1000)
- assert account.save
- assert_equal account, firm.account
- end
-
- def test_failing_build_association
- firm = Firm.new("name" => "GlobalMegaCorp")
- firm.save
-
- account = firm.build_account
- assert !account.save
- assert_equal "can't be empty", account.errors.on("credit_limit")
- end
-
- def test_create_association
- firm = Firm.new("name" => "GlobalMegaCorp")
- firm.save
- assert_equal firm.create_account("credit_limit" => 1000), firm.account
- end
-
def test_has_and_belongs_to_many
david = Developer.find(1)
assert david.has_projects?