Created
January 31, 2014 20:46
-
-
Save danielmorrison/8742783 to your computer and use it in GitHub Desktop.
put inside spec/spec_helper.rb inside the RSpec.configure block
This file contains 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 = :truncation | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.around(:each) do |example| | |
DatabaseCleaner.start | |
example.run | |
DatabaseCleaner.clean | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment