diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-17 00:44:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-17 00:44:55 +0000 |
commit | d598635988e36b3353b38ba079836077557b8387 (patch) | |
tree | aa454bcbfb258ae01b18193ebdfb4a1dfbb18fbe /activerecord | |
parent | 44ac6046c1e7b88e993293fa68ec015d52a7b26c (diff) | |
download | rails-d598635988e36b3353b38ba079836077557b8387.tar.gz rails-d598635988e36b3353b38ba079836077557b8387.tar.bz2 rails-d598635988e36b3353b38ba079836077557b8387.zip |
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
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/test/associations_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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" |