New in Sinatra; I run some rspec tests but get a bunch of unwanted noise in the logs. How to get rid of excessive noise in magazines? I double checked that the environment is set to: test, which means that the registrar level should be set to WARN instead of DEBUG.
spec_helper:
require "./app"
require "sinatra"
require "rspec"
require "rack/test"
require "database_cleaner"
require "factory_girl"
set :environment, :test
FactoryGirl.definition_file_paths = %w{./factories ./test/factories ./spec/factories}
FactoryGirl.find_definitions
RSpec.configure do |config|
config.include Rack::Test::Methods
config.include FactoryGirl::Syntax::Methods
config.color_enabled = true
config.tty = true
config.formatter = :documentation
config.order = "random"
config.before(:suite) do
DatabaseCleaner.clean_with(:deletion)
end
config.before(:each) do
DatabaseCleaner.strategy = :deletion
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
def app
Sinatra::Application
end
app.rb
configure :test do
set :database, 'sqlite3:///test.sqlite'
set :logging, Logger::ERROR
end
noise:
D, [2014-01-16T22:14:28.481790 #75797] DEBUG -- : (0.6ms) commit transaction
D, [2014-01-16T22:14:28.484622 #75797] DEBUG -- : (0.1ms) begin transaction
source
share