From d598635988e36b3353b38ba079836077557b8387 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 17 Jan 2005 00:44:55 +0000 Subject: Added test_forgetting_the_load_when_foreign_key_enters_late git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@436 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index 668bcb54a8..6ed550a730 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -584,6 +584,14 @@ class BelongsToAssociationsTest < Test::Unit::TestCase assert_equal @first_firm, c.firm_with_basic_id end + def test_forgetting_the_load_when_foreign_key_enters_late + c = Client.new + assert_nil c.firm_with_basic_id + + c.firm_id = 1 + assert_equal @first_firm, c.firm_with_basic_id + end + def test_field_name_same_as_foreign_key computer = Computer.find 1 assert_not_nil computer.developer, ":foreign key == attribute didn't lock up" -- cgit v1.2.3