开发者

Database Cleaner mongomapper and cucumber

开发者 https://www.devze.com 2023-04-03 07:48 出处:网络
#/features/support/env.rb ... require \'database_cleaner\' require \'database_cleaner/cucumber\' require \'database_cleaner/mongo_mapper/truncation\'
#/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

精彩评论

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

关注公众号