database_cleaner
database_cleaner copied to clipboard
Strategies for cleaning databases in Ruby. Can be used to ensure a clean state for testing.
```ruby > DatabaseCleaner.clean_with(:truncation, pre_count: true) (reverb):1:in `': PG::FeatureNotSupported: ERROR: cannot truncate a table referenced in a foreign key constraint (ActiveRecord::StatementInvalid) DETAIL: Table "table1" references "table2". HINT: Truncate table "table1" at...
Hi team, sometimes we have this error during running the tests ``` Randomized with seed 38777 ..........................F An error occurred in an `after(:context)` hook. Failure/Error: DatabaseCleaner.clean_with(:truncation, except: %i[translations]) ActiveRecord::ConnectionNotEstablished: connection...
Allow consumers to define their own safeguards and maintain existing behavior for backwards compatibility. - Updates `Safeguard` to use a registry Similar to how RuboCop handles Cops from itself, gems,...