Skip to content

Commit

Permalink
pass the returned response without setting in then step
Browse files Browse the repository at this point in the history
  • Loading branch information
KarunAtreya committed Oct 16, 2023
1 parent 9b0639c commit 54b0445
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Feature: Email notification
And user "Brian" has switched the system language to "es"
And user "Carol" has switched the system language to "de"
And user "Alice" has created a space "new-space" with the default quota using the GraphApi
When user "Alice" has shared a space "new-space" with settings:
When user "Alice" shares a space "new-space" with settings:
| shareWith | group1 |
| role | viewer |
Then the HTTP status code should be "200"
Expand Down
7 changes: 3 additions & 4 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,6 @@ public function theJsonDataFromLastResponseShouldMatch(
null,
$userName,
);

$this->featureContext->assertJsonDocumentMatchesSchema(
$responseBody,
$this->featureContext->getJSONSchema($schemaString)
Expand Down Expand Up @@ -930,7 +929,7 @@ public function checkPermissionsInResponse(
"Expected response status code should be 200",
$response
);
Assert::assertIsArray($spaceAsArray = $this->getSpaceByNameFromResponse($spaceName), "No space with name $spaceName found");
Assert::assertIsArray($spaceAsArray = $this->getSpaceByNameFromResponse($spaceName, $response), "No space with name $spaceName found");
$permissions = $spaceAsArray["root"]["permissions"];
$userId = $this->featureContext->getUserIdByUserName($grantedUser);

Expand Down Expand Up @@ -981,9 +980,9 @@ public function userShouldNotHaveSpace(
$response
);
if (\trim($shouldOrNot) === "not") {
$this->jsonRespondedShouldNotContain($spaceName);
Assert::assertEmpty($this->getSpaceByNameFromResponse($spaceName, $response), "space $spaceName should not be available for a user");
} else {
Assert::assertNotEmpty($this->getSpaceByNameFromResponse($spaceName), "space '$spaceName' should be available for a user '$user' but not found");
Assert::assertNotEmpty($this->getSpaceByNameFromResponse($spaceName, $response), "space '$spaceName' should be available for a user '$user' but not found");
}
}

Expand Down

0 comments on commit 54b0445

Please sign in to comment.