Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions assert/http_assertions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Loading