Jelajahi Sumber

fix: update test assertions

Jose Diaz-Gonzalez 2 tahun lalu
induk
melakukan
d1ed45bbb6
1 mengubah file dengan 10 tambahan dan 3 penghapusan
  1. 10 3
      api/server/handlers/project/create_test.go

+ 10 - 3
api/server/handlers/project/create_test.go

@@ -1,6 +1,7 @@
 package project_test
 
 import (
+	"net/http"
 	"testing"
 
 	"github.com/porter-dev/porter/api/server/handlers/project"
@@ -102,7 +103,9 @@ func TestFailingCreateMethod(t *testing.T) {
 
 	handler.ServeHTTP(rr, req)
 
-	apitest.AssertResponseInternalServerError(t, rr)
+	apitest.AssertResponseError(t, rr, http.StatusInternalServerError, &types.ExternalError{
+		Error: "Cannot write database",
+	})
 }
 
 func TestFailingCreateRoleMethod(t *testing.T) {
@@ -127,7 +130,9 @@ func TestFailingCreateRoleMethod(t *testing.T) {
 
 	handler.ServeHTTP(rr, req)
 
-	apitest.AssertResponseInternalServerError(t, rr)
+	apitest.AssertResponseError(t, rr, http.StatusInternalServerError, &types.ExternalError{
+		Error: "Cannot write database",
+	})
 }
 
 func TestFailingReadMethod(t *testing.T) {
@@ -152,5 +157,7 @@ func TestFailingReadMethod(t *testing.T) {
 
 	handler.ServeHTTP(rr, req)
 
-	apitest.AssertResponseInternalServerError(t, rr)
+	apitest.AssertResponseError(t, rr, http.StatusInternalServerError, &types.ExternalError{
+		Error: "Cannot read from database",
+	})
 }