aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_test.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-08-24 16:25:56 +0000
committerJamis Buck <jamis@37signals.com>2005-08-24 16:25:56 +0000
commit943fde0a55594bb9e75783974e37eba9584ac79b (patch)
tree89716564bbfec769e7791d8d24c3a73b67d4622e /activerecord/test/associations_test.rb
parentaffb615a8a5da2d41383741fd51871261550925e (diff)
downloadrails-943fde0a55594bb9e75783974e37eba9584ac79b.tar.gz
rails-943fde0a55594bb9e75783974e37eba9584ac79b.tar.bz2
rails-943fde0a55594bb9e75783974e37eba9584ac79b.zip
Add a failing test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2047 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-xactiverecord/test/associations_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb
index afb69c0b4b..e20477f3e2 100755
--- a/activerecord/test/associations_test.rb
+++ b/activerecord/test/associations_test.rb
@@ -811,6 +811,15 @@ class BelongsToAssociationsTest < Test::Unit::TestCase
assert_equal num_orders +1, Order.count
assert_equal num_customers +1, Customer.count
end
+
+ def test_association_assignment_sticks
+ client = Client.find(:first)
+ apple = Firm.create("name" => "Apple")
+ client.firm = apple
+ client.save!
+ client.reload
+ assert_equal apple.id, client.firm_id
+ end
end