Skip to content

Commit

Permalink
Review Address
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Sep 21, 2023
1 parent 7b7a6ce commit 133cac7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Feature: copying file using file id
Given using spaces DAV path
And user "Alice" has been created with default attributes and without skeleton files

Scenario Outline: copy a file into a folder in personal space

Scenario Outline: copy a file from folder to the root of personal space
Given user "Alice" has created folder "/folder"
And user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
When user "Alice" copies a file with file_id in URL "<dav-path>" to "/folder/textfile.txt" inside space "Personal"
When user "Alice" copies a file with FILEID in URL "<dav-path>" to "/folder/textfile.txt" inside space "Personal"
Then the HTTP status code should be "201"
And for user "Alice" the space "Personal" should contain these entries:
| folder/textfile.txt |
Expand All @@ -26,7 +27,7 @@ Feature: copying file using file id
And user "Alice" has created folder "folder/sub-folder"
And user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID"
When user "Alice" copies a file with file_id in URL "<dav-path>" to "/folder/sub-folder/textfile.txt" inside space "Personal"
When user "Alice" copies a file with FILEID in URL "<dav-path>" to "/folder/sub-folder/textfile.txt" inside space "Personal"
Then the HTTP status code should be "201"
And for user "Alice" the space "Personal" should contain these entries:
| folder/sub-folder/textfile.txt |
Expand All @@ -40,7 +41,7 @@ Feature: copying file using file id
Given user "Alice" has created folder "/folder"
And user "Alice" has uploaded file with content "some data" to "folder/textfile.txt"
And we save it into "FILEID"
When user "Alice" copies a file with file_id in URL "<dav-path>" to "/textfile.txt" inside space "Personal"
When user "Alice" copies a file with FILEID in URL "<dav-path>" to "/textfile.txt" inside space "Personal"
Then the HTTP status code should be "201"
And for user "Alice" the space "Personal" should contain these entries:
| textfile.txt |
Expand All @@ -50,12 +51,12 @@ Feature: copying file using file id
| /dav/spaces/<<FILEID>> |


Scenario Outline: copy a file from sub-folder to root in personal space
Scenario Outline: copy a file from sub-folder to the root of personal space
Given user "Alice" has created folder "/folder"
And user "Alice" has created folder "folder/sub-folder"
And user "Alice" has uploaded file with content "some data" to "folder/sub-folder/textfile.txt"
And we save it into "FILEID"
When user "Alice" copies a file with file_id in URL "<dav-path>" to "/textfile.txt" inside space "Personal"
When user "Alice" copies a file with FILEID in URL "<dav-path>" to "/textfile.txt" inside space "Personal"
Then the HTTP status code should be "201"
And for user "Alice" the space "Personal" should contain these entries:
| textfile.txt |
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ public function userHasMovedFileWithinSpaceUsingTheWebDAVAPI(
}

/**
* @When /^user "([^"]*)" copies a file with file_id in URL "([^"]*)" to "([^"]*)" inside space "([^"]*)"$/
* @When /^user "([^"]*)" copies a file with FILEID in URL "([^"]*)" to "([^"]*)" inside space "([^"]*)"$/
*
* @param string $user
* @param string $url
Expand Down Expand Up @@ -1779,7 +1779,7 @@ public function destinationHeaderValueWithSpaceName(string $user, string $fileDe
$space = $this->getSpaceByName($user, $spaceName);
$fileDestination = $this->escapePath(\ltrim($fileDestination, "/"));
if ($endPath && str_contains($endPath, 'remote.php')) {
// this is check for when we want to check with the endpoint having `remote.php` in space webdav
// this is check for when we want to test with the endpoint having `remote.php` in space webdav
// by default spaces webdav is '/dav/spaces'
return $this->featureContext->getBaseUrl() . '/remote.php/dav/spaces/' . $space['id'] . '/' . $fileDestination;
}
Expand Down

0 comments on commit 133cac7

Please sign in to comment.