开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜