views:

30

answers:

1

I am running an Integration Test for a Grails application. I am using the easyb plugin. The problem is that the database doesn't seem to get cleared out between Scenarios. My When I run standard Grails Integration Tests, the persistence context is cleared between each test. The easyb Stories are in the Integration folder, but the Grails Integration Test rules don't seem to apply here... So how do you make easyb clean up after itself?

P.S. I'm defining multiple scenarios in the same groovy file fwiw, but I don't think this is necessarily pertinent.

A: 

One possibility is to use transactions. I use this technique in java. You mark your test with transaction annotation. And after the test you rollback database changes.

Next possibility is to run SQL cleanup queries in after scenario section.

amra