0
#/features/support/env.rb
...
require 'database_cleaner'
require 'database_cleaner/cucumber'
require 'database_cleaner/mongo_mapper/truncation'
DatabaseCleaner.strategy = :truncation
Before do
DatabaseCleaner.start
end
After do
DatabaseCleaner.clean
end
Exception encountered by DatabaseCleaner in Cucumber After block: ActiveRecord::ConnectionNotEstablished
如果我之前和後擋評論 - 測試,做工精細沒有DatabaseCleaner
的REE 1.8.7-2011.03 軌(2.3.12) mongo_mapper(0.7.5) 黃瓜(0.8.7) 黃瓜導軌(0.3.2) database_cleaner(0.6.7)