#/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
精彩评论