[tests-only] Api tests for checking conflict status code while creating folder (#6389)

* add tests for checking conflict status code while creating folder

* fix after review
This commit is contained in:
Viktor Scharf
2023-05-25 14:47:32 +02:00
committed by GitHub
parent ca75468211
commit 76b0e744a7
2 changed files with 35 additions and 1 deletions
@@ -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 "<path>" 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 |
@@ -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 "([^"]*)"$/
*