请求数据污染测试输出

时间:2012-09-20 18:28:18

标签: ruby-on-rails ruby rspec cucumber

当我正在运行我的rspec-rails& cucumber-rails测试,每次发出请求时,有关它的信息都会出现在日志输出上,这使得很难跟踪和阅读。

Thing::SearchController
  logs data about searches
Processing by Thing::SearchController#index as HTML
  Parameters: {"q"=>"thingamabob"}
  Rendered vagas/pesquisas/_empty.html.erb (0.2ms)
  Rendered vagas/pesquisas/_facets.html.erb (0.6ms)
  Rendered shared/_check_lang.html.erb (0.9ms)
  Rendered shared/_footer_links.html.erb (1.0ms)
  Rendered shared/_footer.html.erb (3.1ms)
Completed 200 OK in 100ms (Views: 21.4ms | ActiveRecord: 0.0ms | Search: 67.8ms)
  another test

关于如何删除它的任何想法?

以下是我的Gemfile以防万一:

source 'http://rubygems.org'
gem 'rails', '~>3.2'
gem 'mereghost-rails_sql_views'
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter'
gem 'will_paginate'
gem 'capistrano'
gem 'jquery-rails'
gem 'jqueryui_rails'
gem 'nokogiri'
gem 'rabl'
gem 'exception_notification', require: 'exception_notifier'

gem 'tire'
gem 'yajl-ruby', require: 'yajl/json_gem'
gem 'tire-contrib', git: 'https://github.com/karmi/tire-contrib.git', branch: :master

gem 'devise'
gem 'uuid'

group :assets do
  gem 'sass-rails'    
  gem 'coffee-rails'
  gem 'uglifier'
end

group :production, :sitedev do
  gem 'therubyracer'
end

group :production, :development, :sitedev do
  gem 'newrelic_rpm'
end

group :development, :test do
  gem 'rspec-rails'
  gem 'simplecov'
  gem 'guard'
  gem 'guard-rspec'
  gem 'guard-bundler'
  gem 'guard-cucumber'
  gem 'sprinkle'
  gem 'hitch'
  gem 'launchy'
  gem 'ruby-prof'
  gem 'rb-inotify'
end

group :test do
  gem 'cucumber-rails', require: false
  gem 'database_cleaner'
  gem 'factory_girl_rails'
  gem 'vcr'
  gem 'webmock'
end

gem 'omniauth-linkedin'
gem 'omniauth-facebook', '1.4.0'
gem 'mongo'
gem 'bson_ext'

2 个答案:

答案 0 :(得分:0)

这可能是您的代码或测试助手中的内容。

grep -irn puts *
grep -irn Rails.logger *

答案 1 :(得分:0)

您可以设置Rails.logger.level来减少日志中的详细信息量,如Debugging Rails Applications guide

中所述