RSpec.configure do |config|
config.before(:suite) do
#DatabaseCleaner[:mongoid].clean_with(:deletion)
end
config.before(:each) do
# DatabaseCleaner[:mongoid].strategy = :deletion
end
config.before(:each, :js => true) do
#DatabaseCleaner[:mongoid].strategy = :deletion
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
# DatabaseCleaner.clean
end
config.before(:all) do
# DatabaseCleaner.start
end
config.after(:all) do
# DatabaseCleaner.clean
end
end
1条答案
按热度按时间qlckcl4x1#
我发现这个问题是由
DatabaseCleaner
引起的,解决方法是注解掉Databasecleaner
的一些设置。