|
| 1 | +# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors |
| 2 | +# SPDX-License-Identifier: AGPL-3.0-or-later |
| 3 | +Feature: sharing-accept |
| 4 | + Background: |
| 5 | + Given using api version "1" |
| 6 | + Given using old dav path |
| 7 | + |
| 8 | + Scenario: Accepting a non-existent share |
| 9 | + Given user "user0" exists |
| 10 | + And As an "user0" |
| 11 | + When sending "GET" with exact url to "/index.php/apps/files_sharing/accept/ocinternal:999999" |
| 12 | + Then the HTTP status code should be "404" |
| 13 | + |
| 14 | + Scenario: Accepting a share with an invalid share ID |
| 15 | + Given user "user0" exists |
| 16 | + And As an "user0" |
| 17 | + When sending "GET" with exact url to "/index.php/apps/files_sharing/accept/invalid:format" |
| 18 | + Then the HTTP status code should be "404" |
| 19 | + |
| 20 | + Scenario: Accepting a valid share |
| 21 | + Given user "user0" exists |
| 22 | + And user "user1" exists |
| 23 | + And As an "user0" |
| 24 | + When creating a share with |
| 25 | + | path | welcome.txt | |
| 26 | + | shareWith | user1 | |
| 27 | + | shareType | 0 | |
| 28 | + Then the OCS status code should be "100" |
| 29 | + And the HTTP status code should be "200" |
| 30 | + And As an "user1" |
| 31 | + When accepting last share via the accept endpoint |
| 32 | + Then the HTTP status code should be "200" |
| 33 | + |
| 34 | + Scenario: Accepting a share as a different user |
| 35 | + Given user "user0" exists |
| 36 | + And user "user1" exists |
| 37 | + And user "user2" exists |
| 38 | + And As an "user0" |
| 39 | + When creating a share with |
| 40 | + | path | welcome.txt | |
| 41 | + | shareWith | user1 | |
| 42 | + | shareType | 0 | |
| 43 | + Then the OCS status code should be "100" |
| 44 | + And the HTTP status code should be "200" |
| 45 | + And As an "user2" |
| 46 | + When accepting last share via the accept endpoint |
| 47 | + Then the HTTP status code should be "404" |
| 48 | + |
| 49 | + Scenario: Accepting a share that is not a user share |
| 50 | + Given user "user0" exists |
| 51 | + And user "user1" exists |
| 52 | + And user "user2" exists |
| 53 | + And As an "user0" |
| 54 | + And User user0 created a folder drop |
| 55 | + When creating a share with |
| 56 | + | path | drop | |
| 57 | + | shareType | 3 | |
| 58 | + | publicUpload | true | |
| 59 | + Then the OCS status code should be "100" |
| 60 | + And the HTTP status code should be "200" |
| 61 | + And As an "user2" |
| 62 | + When accepting last share via the accept endpoint |
| 63 | + Then the HTTP status code should be "404" |
0 commit comments