DEV: correct heisentest

DEV: correct heisentest

After you visit a page in Rails an INFO is logged, this depending on
timing could land in the string or not

This changes the level to WARN which avoids the issue

From c6adf7f03201efa27dc75525609a39e04b6ed1b0 Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Fri, 30 Nov 2018 15:03:41 +1100
Subject: [PATCH] DEV: correct heisentest

After you visit a page in Rails an INFO is logged, this depending on
timing could land in the string or not

This changes the level to WARN which avoids the issue

diff --git a/spec/requests/application_controller_spec.rb b/spec/requests/application_controller_spec.rb
index 1370518..a18c397 100644
--- a/spec/requests/application_controller_spec.rb
+++ b/spec/requests/application_controller_spec.rb
@@ -25,6 +25,7 @@ RSpec.describe ApplicationController do
       @old_logger = Rails.logger
       @logs = StringIO.new
       Rails.logger = Logger.new(@logs)
+      Rails.logger.level = Logger::WARN
     end
 
     after do

GitHub

this depending on timing could land in the string or not

Can you explain what you mean?

you know … I am not sure what I was thinking here… cause the INFO is actually is not impacting anything here.

Was trying to fix:

  1) ApplicationController invalid request params should not raise a 500 (nor should it log a warning) for bad params
     Failure/Error: expect(@logs.string).not_to include('exception app middleware')
       expected "I, [2018-11-30T03:51:06.092682 #3721]  INFO -- : Started GET \"/latest.json?test=d%DE\" for 127.0.0....RN -- : Failed to handle exception in exception app middleware Invalid encoding for parameter: d�\n" not to include "exception app middleware"
     # ./spec/requests/application_controller_spec.rb:41:in `block (3 levels) in <main>'
     # ------------------
     # --- Caused by: ---
     # Rack::QueryParser::InvalidParameterError:
     #   Invalid encoding for parameter: d�
     #   ./bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/request/utils.rb:37:in `check_param_encoding'

Which still makes very little sense… so I guess the only option is that somehow this is not running:

I am editing the test to include more diagnostics.

1 Like

followup for heisentest is here:

1 Like

Assigning this to you @ZogStriP so you can approve :slight_smile: I can not.