database_cleaner
database_cleaner copied to clipboard
Strategies for cleaning databases in Ruby. Can be used to ensure a clean state for testing.
Below is my database.yml and I want to use DatabaseCleaner on the secondbase test. How would I specify the connection key when I call `DatabaseCleaner[:active_record, { :connection => KEY }`?...
I have two database, one with a model call `Device`, and the other has a model call `User`. When I set up `database_cleaner` according to readme describe: ``` ruby config.use_transactional_fixtures...
Hi, I'm slowly transitioning my tests to use transaction based cleaning instead of truncation. To do this, I'm currently using an around method which will use the strategy I want...
From the readme: https://github.com/DatabaseCleaner/database_cleaner#cucumber-example The example for adding DatabaseCleaner by hand includes a hook that is provided by DatabaseCleaner, as well as defines a second one. If cucumber-rails is included,...
Current edge rails (future Rails 7.1) produces an error from cleaning in `:truncation` or `:deletion` strategies, due to `ActiveRecord::SchemaMigration.table_name` apparently being removed. eg ``` Failure/Error: DatabaseCleaner.clean_with(:truncation) NoMethodError: undefined method `table_name'...
I'm sorry to ask my question here, but as I can't find an explanation elsewhere, I'm asking you because I figure you must have a good grasp of the subject....
Capybara Version: 3.36.0 Driver Information (and browser if relevant): Poltergeist 1.18.1 Jruby v 9.4.2.0 Using DatabaseCleaner v 2.0.1 Expected Behavior Feature spec should complete after showing the result. Actual Behavior...
I know transaction strategy is fastest strategy, however, I have test case that needs test a race condition which not works with the transaction strategy. My question, is it possible...
This might be a rare use case, but I have an app that uses two databases. Here's a snippet from my `database.yml` file: ```yaml test: primary:
Hi there, I'm running against the Rails 7.2 stable branch (`7-2-stable`) and we are getting an error caused by database-cleaner. Ruby: 3.3.1 PostgreSQL: 16.2 Rails: 7.2 rspec-rails: 6.1.2 rspec: 3.13.0...