From 10e8849bd84ba729b286fb47d38a22a37712e5ba Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 23 Feb 2011 16:27:41 +0000 Subject: Use destroy rather than delete to remove the public body in this xapian test. Now that we're using a sql schema format to populate the test database, it creates foreign keys and so on correctly, so a delete, which tries to delete the object without calling any callbacks, fails with a foreign key error as acts_as_versioned means there are still foreign keys to this record from its versions. --- spec/models/xapian_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/models') diff --git a/spec/models/xapian_spec.rb b/spec/models/xapian_spec.rb index cc319c2d7..36836d95b 100644 --- a/spec/models/xapian_spec.rb +++ b/spec/models/xapian_spec.rb @@ -52,14 +52,14 @@ describe PublicBody, " when indexing public bodies with Xapian" do xapian_object.results[0][:model].should == public_bodies(:humpadink_public_body) end - it "should delete public bodies from the index when they are deleted" do + it "should delete public bodies from the index when they are destroyed" do rebuild_xapian_index xapian_object = InfoRequest.full_search([PublicBody], "albatross", 'created_at', true, nil, 100, 1) xapian_object.results.size.should == 1 xapian_object.results[0][:model].should == public_bodies(:humpadink_public_body) - public_bodies(:humpadink_public_body).delete + public_bodies(:humpadink_public_body).destroy update_xapian_index xapian_object = InfoRequest.full_search([PublicBody], "albatross", 'created_at', true, nil, 100, 1) -- cgit v1.2.3