From 6540865d502a47acc99c8cefd01dd45a46a6038a Mon Sep 17 00:00:00 2001 From: Sagar Gurung <46086950+SagarGi@users.noreply.github.com> Date: Thu, 15 Jun 2023 11:50:38 +0545 Subject: [PATCH] [tests-only][full-ci]Added scenarios for quota exceed with API (#6450) * Added scenarios for quota exceed with API * Review Address * changed code * review-address: check for space not exists --------- Co-authored-by: Viktor Scharf --- tests/acceptance/features/apiSpaces/quota.feature | 9 +++++++++ tests/acceptance/features/bootstrap/SpacesContext.php | 1 + 2 files changed, 10 insertions(+) diff --git a/tests/acceptance/features/apiSpaces/quota.feature b/tests/acceptance/features/apiSpaces/quota.feature index 1358811686..bf67676ca0 100644 --- a/tests/acceptance/features/apiSpaces/quota.feature +++ b/tests/acceptance/features/apiSpaces/quota.feature @@ -130,3 +130,12 @@ Feature: State of the quota And user "Brian" has been created with default attributes and without skeleton files When user "Brian" uploads file with content "more than 10 bytes content" to "lorem.txt" using the WebDAV API Then the HTTP status code should be "507" + + @env-config + Scenario: try to create a space with quota greater than OCIS spaces max quota + Given the config "OCIS_SPACES_MAX_QUOTA" has been set to "50" + And user "Brian" has been created with default attributes and without skeleton files + And the administrator has given "Brian" the role "Space Admin" using the settings api + When user "Brian" tries to create a space "new space" of type "project" with quota "51" using the Graph API + Then the HTTP status code should be "400" + And the user "Brian" should not have a space called "new space" diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 2d6acc28d3..093237fa10 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -603,6 +603,7 @@ class SpacesContext implements Context { /** * @When /^user "([^"]*)" creates a space "([^"]*)" of type "([^"]*)" with quota "([^"]*)" using the Graph API$/ + * @When /^user "([^"]*)" tries to create a space "([^"]*)" of type "([^"]*)" with quota "([^"]*)" using the Graph API$/ * * @param string $user * @param string $spaceName