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

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


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