Delete the fixtures on a functionnal test

Hi,

Since couple a day, I block with the delete of my fixtures in my functionnals test. In my controller, I need test a redirect if there are no value.

But i load my fixtures in start of my test and in a specific test I want delete all. Only in this method, not in other method. In API, I discover the method delete_existing_fixtures, who seem the good practice, but I can't find how use it. I have always the information of method not found.

So I want know if anyone has an information for delete my fixtures in a test.

thanks

cyril mougel wrote:

So I want know if anyone has an information for delete my fixtures in a test.

This is just an ActiveRecord question. Given a model called Model, just call Model.destroy_all before the test case that needs to see no records.

Tip: Don't destroy every record in every model. Only destroy the exact ones your tests need destroyed. If you change fixtures or behavior later in a way this test dislikes, it should fail, and that might stop you from making a mistake.