core
core copied to clipboard
Copy file to received shared file
Steps to reproduce
- Alice creates a file "test.txt" with content "original text"
- Alice shares the file with Brian
- Brian creates a file "new.txt" with content "new text"
- Brian copies "new.txt" to "test.txt"
Expected behaviour
Both Alice and Brian see that "test.txt" has the content "new text"
Actual behaviour
Brian now has "test.txt" has the content "new text" The share from Alice to Brian is in the declined state Alice has "test.txt" has the content "original text"
When Brian accepts the declined share from Alice, then Brian sees "test (2).txt" with content "original text"
Server configuration
Current oC10 core master
See PR #40308 for the test scenario(s)
Note: when the files are both "owned" by the same user, then that user can copy from one file to the other and the content is copied (the expected behavior)
Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has uploaded file with content "ownCloud test text file 1" to "/textfile1.txt"
When user "Alice" copies file "/textfile0.txt" to "/textfile1.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/textfile1.txt" for user "Alice" should be "ownCloud test text file 0"
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed.
The scenario for this will still fail. The suggested behavior still needs to be implemented.
$ make test-acceptance-api BEHAT_FEATURE=tests/acceptance/features/apiWebdavProperties1/copyFile.feature:289
...
Feature: copy file
As a user
I want to be able to copy files
So that I can manage my files
Background: # /home/phil/git/owncloud/core/tests/acceptance/features/apiWebdavProperties1/copyFile.feature:7
Given using OCS API version "1" # FeatureContext::usingOcsApiVersion()
And the administrator has set the default folder for received shares to "Shares" # OccContext::theAdministratorHasSetTheDefaultFolderForReceivedSharesTo()
And auto-accept shares has been disabled # FeatureContext::autoAcceptSharesHasBeenDisabled()
And user "Alice" has been created with default attributes and without skeleton files # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt" # FeatureContext::userHasUploadedAFileWithContentTo()
And user "Alice" has uploaded file with content "ownCloud test text file 1" to "/textfile1.txt" # FeatureContext::userHasUploadedAFileWithContentTo()
And user "Alice" has created folder "/FOLDER" # FeatureContext::userHasCreatedFolder()
@issue-40787 @files_sharing-app-required
Scenario Outline: copy a file over the top of an existing file received as a user share # /home/phil/git/owncloud/core/tests/acceptance/features/apiWebdavProperties1/copyFile.feature:289
Given using <dav_version> DAV path # FeatureContext::usingOldOrNewDavPath()
And user "Brian" has been created with default attributes and without skeleton files # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()
And user "Brian" has uploaded file with content "file to share" to "/sharedfile1.txt" # FeatureContext::userHasUploadedAFileWithContentTo()
And user "Brian" has shared file "/sharedfile1.txt" with user "Alice" # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
And user "Alice" has accepted share "/sharedfile1.txt" offered by user "Brian" # FeatureContext::userHasReactedToShareOfferedBy()
When user "Alice" copies file "/textfile1.txt" to "/Shares/sharedfile1.txt" using the WebDAV API # FeatureContext::userCopiesFileUsingTheAPI()
Then the HTTP status code should be "204" # FeatureContext::thenTheHTTPStatusCodeShouldBe()
And as "Alice" file "/Shares/sharedfile1.txt" should exist # FeatureContext::asFileOrFolderShouldExist()
And the content of file "/Shares/sharedfile1.txt" for user "Alice" should be "ownCloud test text file 1" # FeatureContext::contentOfFileForUserShouldBe()
And as "Alice" file "/textfile1.txt" should exist # FeatureContext::asFileOrFolderShouldExist()
And as "Brian" file "/sharedfile1.txt" should exist # FeatureContext::asFileOrFolderShouldExist()
And the content of file "/sharedfile1.txt" for user "Brian" should be "ownCloud test text file 1" # FeatureContext::contentOfFileForUserShouldBe()
Examples:
| dav_version |
| old |
Failed step: And the content of file "/sharedfile1.txt" for user "Brian" should be "ownCloud test text file 1"
The content was expected to be 'ownCloud test text file 1', but actually is 'file to share'. HTTP status was 200
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'ownCloud test text file 1'
+'file to share'
| new |
Failed step: And the content of file "/sharedfile1.txt" for user "Brian" should be "ownCloud test text file 1"
The content was expected to be 'ownCloud test text file 1', but actually is 'file to share'. HTTP status was 200
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'ownCloud test text file 1'
+'file to share'
--- Failed scenarios:
/home/phil/git/owncloud/core/tests/acceptance/features/apiWebdavProperties1/copyFile.feature:304
/home/phil/git/owncloud/core/tests/acceptance/features/apiWebdavProperties1/copyFile.feature:305
2 scenarios (2 failed)
38 steps (36 passed, 2 failed)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.