From 3de678128403f8e735701d4ff9ca43bb5e48a01c Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Wed, 1 Sep 2010 16:32:16 -0400 Subject: [PATCH] Failing test for #5523 When a hbtm record is destroyed then method should return the destroyed instance --- .../has_and_belongs_to_many_associations_test.rb | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb index 8bb8edd..00a705a 100644 --- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb @@ -425,7 +425,11 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase def test_removing_associations_on_destroy david = DeveloperWithBeforeDestroyRaise.find(1) assert !david.projects.empty? - assert_nothing_raised { david.destroy } + assert_nothing_raised { + d = david.destroy + assert_equal d.id, david.id + assert d.frozen? + } assert david.projects.empty? assert DeveloperWithBeforeDestroyRaise.connection.select_all("SELECT * FROM developers_projects WHERE developer_id = 1").empty? end -- 1.7.2