database_cleaner-active_record
database_cleaner-active_record copied to clipboard
Strategies for cleaning databases using ActiveRecord. Can be used to ensure a clean state for testing.
The SelectiveTruncation strategy (where database_cleaner looks at "table_rows" in the information_schema) is always applied with a combination of ActiveRecord and Mysql2 adapter. Unfortunately this strategy is unreliable because table_rows is...
I am using a standard `:transaction` DatabaseCleaner block with rspec: ``` ruby config.around(:each) do |example| DatabaseCleaner[:active_record, connection: :test].cleaning do example.run end end ``` When trying to profile the queries in...
We switched from truncation to deletion for a project of ours because for some reason truncation was incredibly slow on some clients (apparently [this has been observed before](https://groups.google.com/forum/#!topic/ruby-capybara/8LLxs4BGV-E)). Unfortunately, on...
I had noticed that my specs are getting very slow, and started investigating strategies. Apparently the more you truncate, the longer it takes. This behavior seems very strange: ``` ruby...
We use the [PostGIS extension](http://postgis.net/) and the [rgeo AR gem](https://github.com/rgeo/activerecord-postgis-adapter). We use truncation for our `js` tests as well as our `before(:suite)` strategy. The problem is that the PostGIS extension...
I have a remote SQL Server and a Postgres database. Truncate commands are executed in the PostgreSqlAdapter syntax even for SQL Server models and therefore data is not being truncated...
Hi, I am using the hanami framework and the rspec lib to test my code and PG database. When I trying to test one action I get following error: `PG::InFailedSqlTransaction:...
I've used DatabaseCleaner for several years (thanks!) without issues. But my current setup seems to not work properly. Basic setup: - Grape 0.19.2 - ActiveRecord 5.1.3 (+ otr-activerecord 1.2.4) -...
Hi, so im at wits end trying to get this to work. Right now were connecting to MS SQL Server (2014) VM using the Activerecord gem for SQL Server: gem...
Is it possible with `deletion` strategy to reset ids sequence (Postgres) ? Cannot use truncation strategy, because it is really slow for us. (`truncation` - 8 sec, `deletion` 0.3 sec)