diff --git a/tests/acceptance/features/apiSpaces/uploadSpaces.feature b/tests/acceptance/features/apiSpaces/uploadSpaces.feature index 2b890b10bc..dc2451fafb 100644 --- a/tests/acceptance/features/apiSpaces/uploadSpaces.feature +++ b/tests/acceptance/features/apiSpaces/uploadSpaces.feature @@ -1,4 +1,4 @@ -@api +@api Feature: Upload files into a space As a user I want to be able to create folders and files in the space @@ -75,3 +75,18 @@ Feature: Upload files into a space And for user "Alice" the space "Project Ceres" should not contain these entries: | forAlice | | test.txt | + + + Scenario: user cannot create folder with an existing name + Given user "Alice" has created a folder "NewFolder" in space "Project Ceres" + When user "Alice" creates a folder "NewFolder" in space "Project Ceres" using the WebDav Api + Then the HTTP status code should be "405" + + + Scenario Outline: user cannot create subfolder in a nonexistent folder + When user "Alice" tries to create subfolder "" in a nonexistent folder of the space "Project Ceres" using the WebDav Api + Then the HTTP status code should be "409" + Examples: + | path | + | foo/bar | + | foo/bar/baz | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 3b7c2d09d0..4608d43f05 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -1139,6 +1139,25 @@ class SpacesContext implements Context { } } + /** + * @When /^user "([^"]*)" tries to create subfolder "([^"]*)" in a nonexistent folder of the space "([^"]*)" using the WebDav Api$/ + * + * @param string $user + * @param string $subfolder + * @param string $spaceName + * + * @return void + * + * @throws GuzzleException + */ + public function theUserTriesToCreateASubFolderUsingTheGraphApi( + string $user, + string $subfolder, + string $spaceName + ): void { + $this->theUserCreatesAFolderToAnotherOwnerSpaceUsingTheGraphApi($user, $subfolder, $spaceName); + } + /** * @Given /^user "([^"]*)" has created a (?:folder|subfolder) "([^"]*)" in space "([^"]*)"$/ *