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.
This commit is contained in:
Alan Guo Xiang Tan 2023-07-05 12:11:15 +08:00 committed by GitHub
parent de7110d539
commit 96b20077d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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"