开发者

Database Cleaner mongomapper and cucumber

#/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

Result

Exception encountered by DatabaseCleaner in Cucumber After block: ActiveRecord::ConnectionNotEstablished

If I comment Before and After block - tests work fine without 开发者_如何学编程DatabaseCleaner

ree-1.8.7-2011.03 rails (2.3.12) mongo_mapper (0.7.5) cucumber (0.8.7) cucumber-rails (0.3.2) database_cleaner (0.6.7)


looks like it's still using ActiveRecord, try disabling it

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜