[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:
@@ -1,4 +1,4 @@
|
|||||||
@api
|
@api
|
||||||
Feature: Upload files into a space
|
Feature: Upload files into a space
|
||||||
As a user
|
As a user
|
||||||
I want to be able to create folders and files in the space
|
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:
|
And for user "Alice" the space "Project Ceres" should not contain these entries:
|
||||||
| forAlice |
|
| forAlice |
|
||||||
| test.txt |
|
| 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 "([^"]*)"$/
|
* @Given /^user "([^"]*)" has created a (?:folder|subfolder) "([^"]*)" in space "([^"]*)"$/
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user