Ruby on Rails: test db is persisting data. I'm using Cucumber, how do I clear the DB after each scenario?
Preferably, I'd like something to go in this method defined in support/env.rb
After do |scenari开发者_如何学Goo|
end
Add these three lines at the bottom of your env.rb
# http://github.com/bmabey/database_cleaner for more info.
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
精彩评论