From 96b20077d9fad004f805a1b217bd9643689a2f9f Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Wed, 5 Jul 2023 12:11:15 +0800 Subject: [PATCH] DEV: Ignore requests to `/favicon.ico` requests in test env (#22431) This is not a valid route and is causing routing errors to be raised in the test env adding noise to the logs. We'll just "handle" the route in the test env. --- config/routes.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index 14e91fcdb39..11b9b1fa379 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,10 +28,15 @@ Discourse::Application.routes.draw do get "/404-body" => "exceptions#not_found_body" get "/bootstrap" => "bootstrap#index" + if Rails.env.test? || Rails.env.development? get "/bootstrap/plugin-css-for-tests.css" => "bootstrap#plugin_css_for_tests" end + # This is not a valid production route and is causing routing errors to be raised in + # the test env adding noise to the logs. Just handle it here so we eliminate the noise. + get "/favicon.ico", to: proc { [200, {}, [""]] } if Rails.env.test? + post "webhooks/aws" => "webhooks#aws" post "webhooks/mailgun" => "webhooks#mailgun" post "webhooks/mailjet" => "webhooks#mailjet"