database_cleaner
database_cleaner copied to clipboard
Strategies for cleaning databases in Ruby. Can be used to ensure a clean state for testing.
### Setup ``` - Ruby: 3.1.2 - Rails: 7.0.3.1 - PostgreSQL: 14.4 - OS: Ubuntu 20.04.4 LTS on WSL2 - GitHub Actions: - Image: ubuntu-latest - PostgreSQL: 14.2 --- Gemfile.lock:...
I run my specs on Gitlab CI. When I try to run ` bundle exec rspec` I get: ``` -----> Running test: bundle exec rspec An error occurred while loading...
When trying to use DatabaseCleaner 2.0.0 with Ruby 3.1 and a database.yml file containing aliases I get this error: ``` Psych::BadAlias: Unknown alias: default lib/database_cleaner/active_record/base.rb:49:in `load_config' ``` The YAML loading...
This one is hard to reproduce, might not have anything to do with DC but I tracked the issue down to the DC configuration/behavior. I have a code that runs...
I have two databases in my app (ActiveRecord (Postgres) and MongoID (MongoDB)) with this config: ``` config.before(:suite) do DatabaseCleaner[:active_record].clean_with(:truncation) DatabaseCleaner[:mongoid].clean_with(:deletion) end config.before(:each) do DatabaseCleaner[:active_record].strategy = :transaction DatabaseCleaner[:mongoid].strategy = :deletion end...
I debated filing this against [database_cleaner-active_record](https://github.com/DatabaseCleaner/database_cleaner-active_record), but after digging in a bit I think it would need a more comprehensive fix. I have a Rails app running in a Docker...
Have there been any efforts already on getting this gem ready for Ruby 3? this kind of magic: https://github.com/DatabaseCleaner/database_cleaner/blob/master/lib/database_cleaner/cleaner.rb#L43 ```ruby def strategy=(args) strategy, *strategy_args = args ``` won't work in...
I'm running around 2000 tests with `rspec` and _ActiveRecord_. Every now and then, let's say one out of 5 test suite runs (i.e. 1 out of 10,000 tests), **a random...
- ruby: `2.7.2` - rails: `6.0.3.4` - database_cleaner: `1.8.5` - database_cleaner-active_record: `1.8.0` I'm running Rails in development in a Dockerized environment. One of the configured Docker Compose services is a...