aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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