Commit 34dfadc0c9156f2ef217fcf296546295e2a9c11a
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'api' of gitlab.com:participa/noosfero into api
* 'api' of gitlab.com:participa/noosfero: workaround for the api logger
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
lib/noosfero/api/helpers.rb
@@ -40,7 +40,9 @@ require 'grape' | @@ -40,7 +40,9 @@ require 'grape' | ||
40 | end | 40 | end |
41 | 41 | ||
42 | def logger | 42 | def logger |
43 | - Noosfero::API::API.logger | 43 | + logger = Logger.new(File.join(Rails.root, 'log', "#{ENV['RAILS_ENV'] || 'production'}_api.log")) |
44 | + logger.formatter = GrapeLogging::Formatters::Default.new | ||
45 | + logger | ||
44 | end | 46 | end |
45 | 47 | ||
46 | def limit | 48 | def limit |
test/unit/api/helpers_test.rb
@@ -296,7 +296,7 @@ should 'captcha serpro say name or service not known' do | @@ -296,7 +296,7 @@ should 'captcha serpro say name or service not known' do | ||
296 | params[:txtToken_captcha_serpro_gov_br] = '4324343' | 296 | params[:txtToken_captcha_serpro_gov_br] = '4324343' |
297 | params[:captcha_text] = '4324343' | 297 | params[:captcha_text] = '4324343' |
298 | r = test_captcha('127.0.0.1', params, environment) | 298 | r = test_captcha('127.0.0.1', params, environment) |
299 | - assert_equal(_("Serpro captcha error: getaddrinfo: Name or service not known"), r[0][:javascript_console_message]) | 299 | + assert (r[0][:javascript_console_message]).starts_with?("Serpro captcha error: getaddrinfo") |
300 | end | 300 | end |
301 | 301 | ||
302 | ###### END Captcha tests ###### | 302 | ###### END Captcha tests ###### |