-
-
Save dbongo/82997fca5aea39a9fa8be641b7f5192e to your computer and use it in GitHub Desktop.
Database Cleaner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RSpec.configure do |config| | |
| config.before(:suite) do | |
| DatabaseCleaner.clean_with(:truncation) | |
| end | |
| config.before(:each) do | |
| DatabaseCleaner.strategy = :transaction | |
| end | |
| config.before(:each, js: true) do | |
| DatabaseCleaner.strategy = :truncation | |
| end | |
| config.before(:each) do | |
| DatabaseCleaner.start | |
| end | |
| config.after(:each) do | |
| DatabaseCleaner.clean | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment