diff --git a/api/server/server_unit_test.go b/api/server/server_unit_test.go index b2a911607d..60cee8224c 100644 --- a/api/server/server_unit_test.go +++ b/api/server/server_unit_test.go @@ -13,19 +13,20 @@ import ( "github.com/docker/docker/pkg/version" ) -func TesthttpError(t *testing.T) { +func TestHttpError(t *testing.T) { r := httptest.NewRecorder() - httpError(r, fmt.Errorf("No such method")) if r.Code != http.StatusNotFound { t.Fatalf("Expected %d, got %d", http.StatusNotFound, r.Code) } + r = httptest.NewRecorder() httpError(r, fmt.Errorf("This accound hasn't been activated")) if r.Code != http.StatusForbidden { t.Fatalf("Expected %d, got %d", http.StatusForbidden, r.Code) } + r = httptest.NewRecorder() httpError(r, fmt.Errorf("Some error")) if r.Code != http.StatusInternalServerError { t.Fatalf("Expected %d, got %d", http.StatusInternalServerError, r.Code)