diff options
author | Louise Crow <louise.crow@gmail.com> | 2011-02-23 16:27:41 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2011-02-23 16:27:41 +0000 |
commit | 10e8849bd84ba729b286fb47d38a22a37712e5ba (patch) | |
tree | 0b95794d50f54eb9d98f3c6648f07319e2aab48e | |
parent | 2527d04cc33a5ad05aed33b8fb84b220eae8c2e1 (diff) |
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.
-rw-r--r-- | spec/models/xapian_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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) |