Skip to content

A platform for community discussion. Free, open, simple.

DEV: Ignore requests to `/favicon.ico` requests in test env (#22431)

Alan Guo Xiang Tan96b20077d9fa
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"