Rspec: How to suppress warnings and notices when running tests?

陌路散爱 提交于 2019-12-05 01:30:19

Did you set: config.use_transactional_examples = true to false and see if that breaks anything?

I had config.use_transactional_fixtures = true set. This was default (spec_helper generated with rails g rspec:install). I am using FactoryGirl instead of fixtures, getting rid of this setting removed warnings.

Disabling transactions

If you prefer to manage the data yourself, or using another tool like database_cleaner to do it for you, simply tell RSpec to tell Rails not to manage transactions:

RSpec.configure do |config| config.use_transactional_fixtures = false end

https://www.relishapp.com/rspec/rspec-rails/docs/transactions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!