From b1b4cc24374ab1939b7ab3658e8c488d6826ff9e Mon Sep 17 00:00:00 2001 From: Vivek V Date: Mon, 26 Aug 2019 23:51:57 +0530 Subject: [PATCH] Modified http status codes, using constants provided by the http package --- mux_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mux_test.go b/mux_test.go index e252d391..edcee572 100644 --- a/mux_test.go +++ b/mux_test.go @@ -2046,7 +2046,7 @@ func TestNoMatchMethodErrorHandler(t *testing.T) { resp := NewRecorder() r.ServeHTTP(resp, req) - if resp.Code != 405 { + if resp.Code != http.StatusMethodNotAllowed { t.Errorf("Expecting code %v", 405) } @@ -2725,7 +2725,7 @@ func TestMethodNotAllowed(t *testing.T) { router.ServeHTTP(w, req) - if w.Code != 405 { + if w.Code != http.StatusMethodNotAllowed { t.Fatalf("Expected status code 405 (got %d)", w.Code) } } @@ -2798,7 +2798,7 @@ func TestSubrouterNotFound(t *testing.T) { router.ServeHTTP(w, req) - if w.Code != 404 { + if w.Code != http.StatusNotFound { t.Fatalf("Expected status code 404 (got %d)", w.Code) } }