Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-11-12 13:52:53 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-11-16 16:17:01 +0300
commit34a143b05f17ded514b617f6f7316daf101d424c (patch)
treeb9e2f3977fc894a0d9358453e965e04f0165159e /build
parentbf844567a58c29d56664a80cfef61495bb8b7576 (diff)
Add integration tests for creating shares with default expiration dates
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/SharingContext.php6
-rw-r--r--build/integration/sharing_features/sharing-v1.feature106
2 files changed, 112 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/SharingContext.php b/build/integration/features/bootstrap/SharingContext.php
index 2fcca2ee2c7..b1a4c1aa48b 100644
--- a/build/integration/features/bootstrap/SharingContext.php
+++ b/build/integration/features/bootstrap/SharingContext.php
@@ -38,6 +38,12 @@ class SharingContext implements Context, SnippetAcceptingContext {
protected function resetAppConfigs() {
$this->deleteServerConfig('core', 'shareapi_default_permissions');
+ $this->deleteServerConfig('core', 'shareapi_default_internal_expire_date');
+ $this->deleteServerConfig('core', 'shareapi_internal_expire_after_n_days');
+ $this->deleteServerConfig('core', 'internal_defaultExpDays');
+ $this->deleteServerConfig('core', 'shareapi_default_expire_date');
+ $this->deleteServerConfig('core', 'shareapi_expire_after_n_days');
+ $this->deleteServerConfig('core', 'link_defaultExpDays');
$this->deleteServerConfig('sharebymail', 'enforcePasswordProtection');
}
}
diff --git a/build/integration/sharing_features/sharing-v1.feature b/build/integration/sharing_features/sharing-v1.feature
index 38eb2d8a812..b5b4f5341af 100644
--- a/build/integration/sharing_features/sharing-v1.feature
+++ b/build/integration/sharing_features/sharing-v1.feature
@@ -391,6 +391,112 @@ Feature: sharing
And Share fields of last share match with
| permissions | 7 |
+ Scenario: Creating a new internal share with default expiration date
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
+ When creating a share with
+ | path | welcome.txt |
+ | shareWith | user1 |
+ | shareType | 0 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +3 days |
+
+ Scenario: Creating a new internal share with relaxed default expiration date
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
+ And parameter "internal_defaultExpDays" of app "core" is set to "1"
+ When creating a share with
+ | path | welcome.txt |
+ | shareWith | user1 |
+ | shareType | 0 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +1 days |
+
+ Scenario: Creating a new internal share with relaxed default expiration date too large
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
+ And parameter "internal_defaultExpDays" of app "core" is set to "10"
+ When creating a share with
+ | path | welcome.txt |
+ | shareWith | user1 |
+ | shareType | 0 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +3 days |
+
+ Scenario: Creating a new link share with default expiration date
+ Given user "user0" exists
+ And As an "user0"
+ And parameter "shareapi_default_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_expire_after_n_days" of app "core" is set to "3"
+ When creating a share with
+ | path | welcome.txt |
+ | shareType | 3 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +3 days |
+
+ Scenario: Creating a new link share with relaxed default expiration date
+ Given user "user0" exists
+ And As an "user0"
+ And parameter "shareapi_default_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_expire_after_n_days" of app "core" is set to "3"
+ And parameter "link_defaultExpDays" of app "core" is set to "1"
+ When creating a share with
+ | path | welcome.txt |
+ | shareType | 3 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +1 days |
+
+ Scenario: Creating a new link share with relaxed default expiration date too large
+ Given user "user0" exists
+ And As an "user0"
+ And parameter "shareapi_default_expire_date" of app "core" is set to "yes"
+ And parameter "shareapi_expire_after_n_days" of app "core" is set to "3"
+ And parameter "link_defaultExpDays" of app "core" is set to "10"
+ When creating a share with
+ | path | welcome.txt |
+ | shareType | 3 |
+ And the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Getting info of last share
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And Share fields of last share match with
+ | expiration | +3 days |
+
Scenario: getting all shares of a user using that user
Given user "user0" exists
And user "user1" exists