Created
August 6, 2012 20:32
-
-
Save stevencwarren/3278187 to your computer and use it in GitHub Desktop.
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
| config.before :suite do | |
| DatabaseCleaner.strategy = :transaction | |
| DatabaseCleaner.clean_with(:truncation) | |
| end | |
| # Request specs cannot use a transaction because Capybara runs in a | |
| # separate thread with a different database connection. | |
| config.before type: :request do | |
| DatabaseCleaner.strategy = :truncation | |
| end | |
| config.before do | |
| DatabaseCleaner.start | |
| end | |
| config.after do | |
| DatabaseCleaner.clean | |
| end | |
| via http://highgroove.com/articles/2012/04/06/sane-rspec-config-for-clean,-and-slightly-faster,-specs.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment