#/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)
答案 0 :(得分:0)
看起来它仍在使用ActiveRecord,请尝试禁用它