Commit 588bba1ddbc5efe5b47688d9275c8dfb19ec5a02
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'api' into production
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 | 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 ###### | ... | ... |