Skip to content

Commit

Permalink
Fix capitalization of 'name' property in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rhafer committed May 30, 2024
1 parent 5327f90 commit c425c17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/apis/http/graph/spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Create a new space with properties.
curl -L -X POST 'https://localhost:9200/graph/v1.0/drives/' \
-H 'Content-Type: application/json' \
--data-raw '{
"Name": "Marketing",
"name": "Marketing",
"description": "Marketing team resources",
"quota": {
"total": 5368709120
Expand Down
20 changes: 10 additions & 10 deletions services/graph/pkg/service/v0/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ var _ = Describe("Graph", func() {
Constraint: v0.Permission_CONSTRAINT_ALL,
},
}, nil)
jsonBody := []byte(`{"Name": "Test Space"`)
jsonBody := []byte(`{"name": "Test Space"`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand All @@ -596,7 +596,7 @@ var _ = Describe("Graph", func() {
},
}, nil)
gatewayClient.On("CreateStorageSpace", mock.Anything, mock.Anything).Return(&provider.CreateStorageSpaceResponse{}, errors.New("transport error"))
jsonBody := []byte(`{"Name": "Test Space"}`)
jsonBody := []byte(`{"name": "Test Space"}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand All @@ -620,7 +620,7 @@ var _ = Describe("Graph", func() {
Status: status.NewPermissionDenied(ctx, nil, "grpc permission denied"),
}, nil)

jsonBody := []byte(`{"Name": "Test Space"}`)
jsonBody := []byte(`{"name": "Test Space"}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand All @@ -644,7 +644,7 @@ var _ = Describe("Graph", func() {
Status: status.NewInternal(ctx, "grpc error"),
}, nil)

jsonBody := []byte(`{"Name": "Test Space"}`)
jsonBody := []byte(`{"name": "Test Space"}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand All @@ -664,7 +664,7 @@ var _ = Describe("Graph", func() {
Constraint: v0.Permission_CONSTRAINT_ALL,
},
}, nil)
jsonBody := []byte(`{"Name": ""}`)
jsonBody := []byte(`{"name": ""}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand All @@ -684,7 +684,7 @@ var _ = Describe("Graph", func() {
Constraint: v0.Permission_CONSTRAINT_ALL,
},
}, nil)
jsonBody := []byte(`{"Name": "uufZ2MEUjUMJa84RkPsjJ1zf4XXRTdVMxRsJGfevwHuUBojo5JEdNU22O1FGgzXXTi9tl5ZKWaluIef8pPmEAxn9lHGIjyDVYeRQPiX5PCAZ7rVszrpLJryY5x1p6fFGQ6WQsPpNaqnKnfMliJDsbkAwMf7rCpzo0GUuadgHY9s2mfoXHDnpxqEmDsheucqVAFcNlFZNbNHoZAebHfv78KYc8C0WnhWvqvSPGBkNPQbZUkFCOAIlqpQ2Q3MubgI2"}`)
jsonBody := []byte(`{"name": "uufZ2MEUjUMJa84RkPsjJ1zf4XXRTdVMxRsJGfevwHuUBojo5JEdNU22O1FGgzXXTi9tl5ZKWaluIef8pPmEAxn9lHGIjyDVYeRQPiX5PCAZ7rVszrpLJryY5x1p6fFGQ6WQsPpNaqnKnfMliJDsbkAwMf7rCpzo0GUuadgHY9s2mfoXHDnpxqEmDsheucqVAFcNlFZNbNHoZAebHfv78KYc8C0WnhWvqvSPGBkNPQbZUkFCOAIlqpQ2Q3MubgI2"}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand All @@ -704,7 +704,7 @@ var _ = Describe("Graph", func() {
Constraint: v0.Permission_CONSTRAINT_ALL,
},
}, nil)
jsonBody := []byte(`{"Name": "Test", "DriveType": "media"}`)
jsonBody := []byte(`{"name": "Test", "DriveType": "media"}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand All @@ -724,7 +724,7 @@ var _ = Describe("Graph", func() {
Constraint: v0.Permission_CONSTRAINT_ALL,
},
}, nil)
jsonBody := []byte(`{"Name": "Space / Name"}`)
jsonBody := []byte(`{"name": "Space / Name"}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand Down Expand Up @@ -770,7 +770,7 @@ var _ = Describe("Graph", func() {
TotalBytes: 500,
}, nil)

jsonBody := []byte(`{"Name": "Test Space", "DriveType": "project", "Description": "This space is for testing", "DriveAlias": "project/testspace"}`)
jsonBody := []byte(`{"name": "Test Space", "driveType": "project", "description": "This space is for testing", "DriveAlias": "project/testspace"}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand Down Expand Up @@ -801,7 +801,7 @@ var _ = Describe("Graph", func() {
Constraint: v0.Permission_CONSTRAINT_ALL,
},
}, nil)
jsonBody := []byte(`{"Name": "Test Space"}`)
jsonBody := []byte(`{"name": "Test Space"}`)
r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx)
rr := httptest.NewRecorder()
svc.CreateDrive(rr, r)
Expand Down
6 changes: 3 additions & 3 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ public function theUserCreatesASpaceWithQuotaUsingTheGraphApi(
string $spaceType,
?int $quota = null
): void {
$space = ["Name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]];
$space = ["name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]];
$body = json_encode($space);
$response = GraphHelper::createSpace(
$this->featureContext->getBaseUrl(),
Expand Down Expand Up @@ -1657,7 +1657,7 @@ public function userHasCreatedSpace(
string $spaceType,
int $quota
): void {
$space = ["Name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]];
$space = ["name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]];
$response = $this->createSpace($user, $space);
$this->addCreatedSpace($user, $response);
$this->featureContext->theHTTPStatusCodeShouldBe(
Expand All @@ -1682,7 +1682,7 @@ public function theUserHasCreatedASpaceByDefaultUsingTheGraphApi(
string $user,
string $spaceName
): void {
$space = ["Name" => $spaceName];
$space = ["name" => $spaceName];
$response = $this->createSpace($user, $space);
$this->addCreatedSpace($user, $response);
$this->featureContext->theHTTPStatusCodeShouldBe(
Expand Down

0 comments on commit c425c17

Please sign in to comment.