README.md in database_flusher-0.3.1 vs README.md in database_flusher-0.3.2

- old
+ new

@@ -5,11 +5,11 @@ database_flusher is a tiny and fast database cleaner inspired by [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) and [database_rewinder](https://github.com/amatsuda/database_rewinder). ## Features -* No monkey patching - uses `ActiveSupport::Notifications` and `Mongo::Monitoring::Global` to catch `INSERT` statements +* No monkey patching - uses `ActiveSupport::Notifications` and `Mongo::Monitoring` to catch `INSERT` statements * Fast `:deletion` strategy that cleans only tables/collections where `INSERT` statements were performed * Faster `disable_referential_integrity` for PostgreSQL * Executes multiple `DELETE` statements as one query with ActiveRecord * Supports only one database for each ORM @@ -103,20 +103,17 @@ end DatabaseFlusher[:active_record].strategy = :transaction DatabaseFlusher[:mongoid].strategy = :deletion -Before do +# Use Around hook to make sure it runs after capybara session reset. +Around do |scenario, block| if Capybara.current_driver == :rack_test DatabaseFlusher[:active_record].strategy = :transaction else DatabaseFlusher[:active_record].strategy = :deletion end - DatabaseFlusher.start -end - -After do - DatabaseFlusher.clean + DatabaseFlusher.cleaning(&block) end ``` ## Contributing