Commit 34dfadc0c9156f2ef217fcf296546295e2a9c11a

Authored by Evandro Junior
2 parents 35e9362c 85dc60d0

Merge branch 'api' of gitlab.com:participa/noosfero into api

* 'api' of gitlab.com:participa/noosfero:
  workaround for the api logger
lib/noosfero/api/helpers.rb
... ... @@ -40,7 +40,9 @@ require 'grape'
40 40 end
41 41  
42 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 46 end
45 47  
46 48 def limit
... ...
test/unit/api/helpers_test.rb
... ... @@ -296,7 +296,7 @@ should 'captcha serpro say name or service not known' do
296 296 params[:txtToken_captcha_serpro_gov_br] = '4324343'
297 297 params[:captcha_text] = '4324343'
298 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 300 end
301 301  
302 302 ###### END Captcha tests ######
... ...