Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions build/integration/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ public function creatingShare($body) {
$this->asCreatingAShareWith($this->currentUser, $body);
}

/**
* @When /^accepting last share via the accept endpoint$/
*/
public function acceptingLastShareViaAcceptEndpoint(): void {
$share_id = $this->lastShareData->data[0]->id;
$url = "/index.php/apps/files_sharing/accept/ocinternal:$share_id";
$this->sendingToDirectUrl('GET', $url);
}

/**
* @When /^accepting last share$/
*/
Expand Down
63 changes: 63 additions & 0 deletions build/integration/sharing_features/sharing-accept.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
Feature: sharing-accept
Background:
Given using api version "1"
Given using old dav path

Scenario: Accepting a non-existent share
Given user "user0" exists
And As an "user0"
When sending "GET" with exact url to "/index.php/apps/files_sharing/accept/ocinternal:999999"
Then the HTTP status code should be "404"

Scenario: Accepting a share with an invalid share ID
Given user "user0" exists
And As an "user0"
When sending "GET" with exact url to "/index.php/apps/files_sharing/accept/invalid:format"
Then the HTTP status code should be "404"

Scenario: Accepting a valid share
Given user "user0" exists
And user "user1" exists
And As an "user0"
When creating a share with
| path | welcome.txt |
| shareWith | user1 |
| shareType | 0 |
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And As an "user1"
When accepting last share via the accept endpoint
Then the HTTP status code should be "200"

Scenario: Accepting a share as a different user
Given user "user0" exists
And user "user1" exists
And user "user2" exists
And As an "user0"
When creating a share with
| path | welcome.txt |
| shareWith | user1 |
| shareType | 0 |
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And As an "user2"
When accepting last share via the accept endpoint
Then the HTTP status code should be "404"

Scenario: Accepting a share that is not a user share
Given user "user0" exists
And user "user1" exists
And user "user2" exists
And As an "user0"
And User user0 created a folder drop
When creating a share with
| path | drop |
| shareType | 3 |
| publicUpload | true |
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And As an "user2"
When accepting last share via the accept endpoint
Then the HTTP status code should be "404"
Loading