From e822ed6159aefcc29a42f3c99be658ae21b3049f Mon Sep 17 00:00:00 2001 From: Renan Pimentel Date: Thu, 22 Oct 2026 17:52:42 -0300 Subject: [PATCH] test: cover HTTP 300 redirect assertion --- assert/http_assertions_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/assert/http_assertions_test.go b/assert/http_assertions_test.go index a1dd4540d..ef2a7a8c2 100644 --- a/assert/http_assertions_test.go +++ b/assert/http_assertions_test.go @@ -86,6 +86,19 @@ func TestHTTPRedirect(t *testing.T) { assert.True(mockT4.Failed()) } +func TestHTTPRedirectIncludesMultipleChoices(t *testing.T) { + handler := func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusMultipleChoices) + } + mockT := new(mockTestingT) + if !HTTPRedirect(mockT, handler, "GET", "/", nil) { + t.Error("HTTP 300 should be classified as a redirect") + } + if mockT.Failed() { + t.Error("HTTPRedirect should not report an assertion failure for HTTP 300") + } +} + func TestHTTPError(t *testing.T) { t.Parallel()