From a990e0ac1d5a50618ed976e3354e47e443277de9 Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Wed, 18 Nov 2015 11:09:34 +0000 Subject: [PATCH 1/7] Added some requirements for first test case --- .../features/bootstrap/FeatureContext.php | 108 ++++++++++++++++-- build/integration/features/sharing-v1.feature | 30 +++++ .../features/webdav-related.feature | 20 ++++ 3 files changed, 150 insertions(+), 8 deletions(-) create mode 100644 build/integration/features/webdav-related.feature diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 3d579f52810..7176a19064a 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -238,8 +238,23 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** - * @Given /^user "([^"]*)" belongs to group "([^"]*)"$/ + * @Then /^check that user "([^"]*)" belongs to group "([^"]*)"$/ */ + public function checkThatUserBelongsToGroup($user, $group) { + $fullUrl = $this->baseUrl . "v2.php/cloud/users/$user/groups"; + $client = new Client(); + $options = []; + if ($this->currentUser === 'admin') { + $options['auth'] = $this->adminUser; + } + + $this->response = $client->get($fullUrl, $options); + $respondedArray = $this->getArrayOfGroupsResponded($this->response); + sort($respondedArray); + PHPUnit_Framework_Assert::assertContains($group, $respondedArray); + PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode()); + } + public function userBelongsToGroup($user, $group) { $fullUrl = $this->baseUrl . "v2.php/cloud/users/$user/groups"; $client = new Client(); @@ -251,8 +266,26 @@ class FeatureContext implements Context, SnippetAcceptingContext { $this->response = $client->get($fullUrl, $options); $groups = array($group); $respondedArray = $this->getArrayOfGroupsResponded($this->response); - PHPUnit_Framework_Assert::assertEquals($groups, $respondedArray, "", 0.0, 10, true); - PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode()); + + if (array_key_exists($group, $respondedArray)) { + return True; + } else{ + return False; + } + } + + /** + * @Given /^user "([^"]*)" belongs to group "([^"]*)"$/ + */ + public function assureUserBelongsToGroup($user, $group){ + if (!$this->userBelongsToGroup($user, $group)){ + $previous_user = $this->currentUser; + $this->currentUser = "admin"; + $this->addingUserToGroup($user, $group); + $this->currentUser = $previous_user; + } + $this->checkThatUserBelongsToGroup($user, $group); + } /** @@ -818,10 +851,10 @@ class FeatureContext implements Context, SnippetAcceptingContext { PHPUnit_Framework_Assert::assertEquals(False, $this->isFieldInResponse('share_with', "$user")); } - public function isUserInSharedData($user){ + public function isUserOrGroupInSharedData($userOrGroup){ $data = $this->response->xml()->data[0]; foreach($data as $element) { - if ($element->share_with == $user){ + if ($element->share_with == $userOrGroup){ return True; } } @@ -841,13 +874,70 @@ class FeatureContext implements Context, SnippetAcceptingContext { $options['auth'] = [$user1, $this->regularUser]; } $this->response = $client->get($fullUrl, $options); - if ($this->isUserInSharedData($user2)){ + if ($this->isUserOrGroupInSharedData($user2)){ return; } else { $this->createShare($user1, $filepath, 0, $user2, null, null, null); } $this->response = $client->get($fullUrl, $options); - PHPUnit_Framework_Assert::assertEquals(True, $this->isUserInSharedData($user2)); + PHPUnit_Framework_Assert::assertEquals(True, $this->isUserOrGroupInSharedData($user2)); + } + + /** + * @Given /^file "([^"]*)" from user "([^"]*)" is shared with group "([^"]*)"$/ + */ + public function assureFileIsSharedWithGroup($filepath, $user, $group){ + $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares" . "?path=$filepath"; + $client = new Client(); + $options = []; + if ($user === 'admin') { + $options['auth'] = $this->adminUser; + } else { + $options['auth'] = [$user, $this->regularUser]; + } + $this->response = $client->get($fullUrl, $options); + if ($this->isUserOrGroupInSharedData($group)){ + return; + } else { + $this->createShare($user, $filepath, 1, $group, null, null, null); + } + $this->response = $client->get($fullUrl, $options); + PHPUnit_Framework_Assert::assertEquals(True, $this->isUserOrGroupInSharedData($group)); + } + + public function makeDavRequest($user, $method, $path, $headers){ + $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav" . "$path"; + $client = new Client(); + $options = []; + if ($user === 'admin') { + $options['auth'] = $this->adminUser; + } else { + $options['auth'] = [$user, $this->regularUser]; + } + $request = $client->createRequest($method, $fullUrl, $options); + foreach ($headers as $key => $value) { + $request->addHeader($key, $value); + } + $this->response = $client->send($request); + } + + /** + * @Given /^User "([^"]*)" moved file "([^"]*)" to "([^"]*)"$/ + */ + public function userMovedFile($user, $fileSource, $fileDestination){ + $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav"; + $headers['Destination'] = $fullUrl . $fileDestination; + $this->makeDavRequest($user, "MOVE", $fileSource, $headers); + PHPUnit_Framework_Assert::assertEquals(201, $this->response->getStatusCode()); + } + + /** + * @When /^User "([^"]*)" moves file "([^"]*)" to "([^"]*)"$/ + */ + public function userMovesFile($user, $fileSource, $fileDestination){ + $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav"; + $headers['Destination'] = $fullUrl . $fileDestination; + $this->makeDavRequest($user, "MOVE", $fileSource, $headers); } /** @@ -877,7 +967,9 @@ class FeatureContext implements Context, SnippetAcceptingContext { $fd = $body->getRowsHash(); foreach($fd as $field => $value) { - PHPUnit_Framework_Assert::assertEquals(True, $this->isFieldInResponse($field, $value)); + if (!$this->isFieldInResponse($field, $value)){ + PHPUnit_Framework_Assert::fail("$field" . " doesn't have value " . "$value"); + } } } } diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 07c05af2f54..aceff1de1a3 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -272,6 +272,36 @@ Feature: sharing | share_with_displayname | user1 | | displayname_owner | user0 | + Scenario: keep group permissions in sync + Given As an "admin" + Given user "user0" exists + And user "user1" exists + And group "group1" exists + And user "user1" belongs to group "group1" + And file "textfile0.txt" from user "user0" is shared with group "group1" + And User "user1" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt" + And As an "user0" + When Updating last share with + | permissions | 1 | + 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 + | id | A_NUMBER | + | item_type | file | + | item_source | A_NUMBER | + | share_type | 1 | + | file_source | A_NUMBER | + | file_target | /textfile0.txt | + | permissions | 1 | + | stime | A_NUMBER | + | storage | A_NUMBER | + | mail_send | 0 | + | uid_owner | user0 | + | storage_id | home::user0 | + | file_parent | A_NUMBER | + | displayname_owner | user0 | + Scenario: delete a share Given user "user0" exists And user "user1" exists diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature new file mode 100644 index 00000000000..450065ded2d --- /dev/null +++ b/build/integration/features/webdav-related.feature @@ -0,0 +1,20 @@ +Feature: sharing + Background: + Given using api version "1" + + Scenario: moving a file + Given As an "admin" + And user "user0" exists + When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" + Then the HTTP status code should be "201" + + + + + + + + + + + From 630ba2fd0948b01db16b258a064bf3ca02302d1d Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Thu, 19 Nov 2015 09:36:56 +0000 Subject: [PATCH 2/7] Added test for shared_with_me parameter --- .../features/bootstrap/FeatureContext.php | 13 ++++++++++++- build/integration/features/sharing-v1.feature | 10 ++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 7176a19064a..56b81d631a7 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -800,7 +800,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { elseif($contentExpected == "AN_URL"){ return $this->isExpectedUrl((string)$element->$field, "index.php/s/"); } - elseif ($element->$field == $contentExpected){ + elseif ((string)$element->$field == $contentExpected){ return True; } } @@ -958,6 +958,17 @@ class FeatureContext implements Context, SnippetAcceptingContext { $this->sendingToWith("GET", $url, null); } + /** + * @Then /^last share_id is included in the answer$/ + */ + public function findingLastShareID(){ + print_r($this->response->xml()); + $share_id = $this->lastShareData->data[0]->id; + if (!$this->isFieldInResponse('id', $share_id)){ + PHPUnit_Framework_Assert::fail("Share id $share_id not found in response"); + } + } + /** * @Then /^Share fields of last share match with$/ * @param \Behat\Gherkin\Node\TableNode|null $formData diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index aceff1de1a3..0100ab3eda1 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -302,6 +302,16 @@ Feature: sharing | file_parent | A_NUMBER | | displayname_owner | user0 | + Scenario: Sharee can see the share + Given user "user0" exists + And user "user1" exists + And file "textfile0.txt" from user "user0" is shared with user "user1" + And As an "user1" + When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And last share_id is included in the answer + Scenario: delete a share Given user "user0" exists And user "user1" exists From 81e0a3ea2211cd2d3ea9d543c2523970be17867c Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Thu, 19 Nov 2015 10:28:38 +0000 Subject: [PATCH 3/7] Added test and logic for deleting all group shares --- .../features/bootstrap/FeatureContext.php | 13 +++++++++++-- build/integration/features/sharing-v1.feature | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 56b81d631a7..9daebd1e165 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -961,14 +961,23 @@ class FeatureContext implements Context, SnippetAcceptingContext { /** * @Then /^last share_id is included in the answer$/ */ - public function findingLastShareID(){ - print_r($this->response->xml()); + public function checkingLastShareIDIsIncluded(){ $share_id = $this->lastShareData->data[0]->id; if (!$this->isFieldInResponse('id', $share_id)){ PHPUnit_Framework_Assert::fail("Share id $share_id not found in response"); } } + /** + * @Then /^last share_id is not included in the answer$/ + */ + public function checkingLastShareIDIsNotIncluded(){ + $share_id = $this->lastShareData->data[0]->id; + if ($this->isFieldInResponse('id', $share_id)){ + PHPUnit_Framework_Assert::fail("Share id $share_id has been found in response"); + } + } + /** * @Then /^Share fields of last share match with$/ * @param \Behat\Gherkin\Node\TableNode|null $formData diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 0100ab3eda1..6f62793f8df 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -312,6 +312,22 @@ Feature: sharing And the HTTP status code should be "200" And last share_id is included in the answer + Scenario: Delete all group shares + Given As an "admin" + And user "user0" exists + And user "user1" exists + And group "group1" exists + And user "user1" belongs to group "group1" + And file "textfile0.txt" from user "user0" is shared with group "group1" + And User "user1" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt" + And As an "user0" + And Deleting last share + And As an "user1" + When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true" + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And last share_id is not included in the answer + Scenario: delete a share Given user "user0" exists And user "user1" exists From ee4a18a16cd964338b417b0a312a6a67c54e7f53 Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Thu, 19 Nov 2015 14:17:56 +0000 Subject: [PATCH 4/7] added test about resharing --- .../features/bootstrap/FeatureContext.php | 4 +- build/integration/features/sharing-v1.feature | 37 +++++++++++++++---- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 9daebd1e165..329b18d151c 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -599,10 +599,10 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** - * @When /^creating a public share with$/ + * @When /^creating a share with$/ * @param \Behat\Gherkin\Node\TableNode|null $formData */ - public function createPublicShare($body) { + public function creatingShare($body) { $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v1/shares"; $client = new Client(); $options = []; diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 6f62793f8df..0d64fcd8bcb 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -28,7 +28,7 @@ Feature: sharing Scenario: Creating a new public share Given user "user0" exists And As an "user0" - When creating a public share with + When creating a share with | path | welcome.txt | | shareType | 3 | Then the OCS status code should be "100" @@ -38,7 +38,7 @@ Feature: sharing Scenario: Creating a new public share with password Given user "user0" exists And As an "user0" - When creating a public share with + When creating a share with | path | welcome.txt | | shareType | 3 | | password | publicpw | @@ -49,7 +49,7 @@ Feature: sharing Scenario: Creating a new public share of a folder Given user "user0" exists And As an "user0" - When creating a public share with + When creating a share with | path | FOLDER | | shareType | 3 | | password | publicpw | @@ -68,7 +68,7 @@ Feature: sharing Scenario: Creating a new public share with password and adding an expiration date Given user "user0" exists And As an "user0" - When creating a public share with + When creating a share with | path | welcome.txt | | shareType | 3 | | password | publicpw | @@ -81,7 +81,7 @@ Feature: sharing Scenario: Creating a new public share, updating its expiration date and getting its info Given user "user0" exists And As an "user0" - When creating a public share with + When creating a share with | path | FOLDER | | shareType | 3 | And Updating last share with @@ -111,7 +111,7 @@ Feature: sharing Scenario: Creating a new public share, updating its password and getting its info Given user "user0" exists And As an "user0" - When creating a public share with + When creating a share with | path | FOLDER | | shareType | 3 | And Updating last share with @@ -140,7 +140,7 @@ Feature: sharing Scenario: Creating a new public share, updating its permissions and getting its info Given user "user0" exists And As an "user0" - When creating a public share with + When creating a share with | path | FOLDER | | shareType | 3 | And Updating last share with @@ -169,7 +169,7 @@ Feature: sharing Scenario: Creating a new public share, updating publicUpload option and getting its info Given user "user0" exists And As an "user0" - When creating a public share with + When creating a share with | path | FOLDER | | shareType | 3 | And Updating last share with @@ -312,6 +312,27 @@ Feature: sharing And the HTTP status code should be "200" And last share_id is included in the answer + Scenario: User is not allowed to reshare file + As an "admin" + Given user "user0" exists + And user "user1" exists + And user "user2" exists + And As an "user0" + And creating a share with + | path | /textfile0.txt | + | shareType | 0 | + | shareWith | user1 | + | permissions | 8 | + And As an "user1" + When creating a share with + | path | /textfile0. (2).txt | + | shareType | 0 | + | shareWith | user2 | + | permissions | 31 | + Then the OCS status code should be "404" + And the HTTP status code should be "200" + + Scenario: Delete all group shares Given As an "admin" And user "user0" exists From dd10e1d538e91bdebad0c250a62d06afe9d74b55 Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Fri, 20 Nov 2015 09:17:48 +0000 Subject: [PATCH 5/7] modified makedavrequest to return response --- build/integration/features/bootstrap/FeatureContext.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 329b18d151c..3a4b619fe7a 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -918,7 +918,8 @@ class FeatureContext implements Context, SnippetAcceptingContext { foreach ($headers as $key => $value) { $request->addHeader($key, $value); } - $this->response = $client->send($request); + //$this->response = $client->send($request); + return $client->send($request); } /** @@ -927,7 +928,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { public function userMovedFile($user, $fileSource, $fileDestination){ $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav"; $headers['Destination'] = $fullUrl . $fileDestination; - $this->makeDavRequest($user, "MOVE", $fileSource, $headers); + $this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers); PHPUnit_Framework_Assert::assertEquals(201, $this->response->getStatusCode()); } @@ -937,7 +938,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { public function userMovesFile($user, $fileSource, $fileDestination){ $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav"; $headers['Destination'] = $fullUrl . $fileDestination; - $this->makeDavRequest($user, "MOVE", $fileSource, $headers); + $this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers); } /** From a2938385f9f5d585eacdbe15791b913614c94f9d Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Fri, 20 Nov 2015 11:26:52 +0000 Subject: [PATCH 6/7] Making webdav path configurable --- .../features/bootstrap/FeatureContext.php | 16 +++++++++++++--- build/integration/features/sharing-v1.feature | 1 + .../integration/features/webdav-related.feature | 15 +++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 3a4b619fe7a..b3d928bb21d 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -27,6 +27,9 @@ class FeatureContext implements Context, SnippetAcceptingContext { /** @var int */ private $sharingApiVersion = 1; + /** @var string*/ + private $davPath = "remote.php/webdav"; + /** @var SimpleXMLElement */ private $lastShareData = null; @@ -211,6 +214,13 @@ class FeatureContext implements Context, SnippetAcceptingContext { $this->apiVersion = $version; } + /** + * @Given /^using dav path "([^"]*)"$/ + */ + public function usingDavPath($davPath) { + $this->davPath = $davPath; + } + /** * @Given /^user "([^"]*)" exists$/ */ @@ -906,7 +916,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { } public function makeDavRequest($user, $method, $path, $headers){ - $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav" . "$path"; + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . "$path"; $client = new Client(); $options = []; if ($user === 'admin') { @@ -926,7 +936,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { * @Given /^User "([^"]*)" moved file "([^"]*)" to "([^"]*)"$/ */ public function userMovedFile($user, $fileSource, $fileDestination){ - $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav"; + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath; $headers['Destination'] = $fullUrl . $fileDestination; $this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers); PHPUnit_Framework_Assert::assertEquals(201, $this->response->getStatusCode()); @@ -936,7 +946,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { * @When /^User "([^"]*)" moves file "([^"]*)" to "([^"]*)"$/ */ public function userMovesFile($user, $fileSource, $fileDestination){ - $fullUrl = substr($this->baseUrl, 0, -4) . "remote.php/webdav"; + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath; $headers['Destination'] = $fullUrl . $fileDestination; $this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers); } diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 0d64fcd8bcb..33085866bf4 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -1,6 +1,7 @@ Feature: sharing Background: Given using api version "1" + Given using dav path "remote.php/webdav" Scenario: Creating a new share with user Given user "user0" exists diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature index 450065ded2d..27d354644d0 100644 --- a/build/integration/features/webdav-related.feature +++ b/build/integration/features/webdav-related.feature @@ -1,12 +1,15 @@ Feature: sharing Background: - Given using api version "1" + Given using api version "1" + + Scenario: moving a file old way + Given using dav path "remote.php/webdav" + And As an "admin" + And user "user0" exists + When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" + Then the HTTP status code should be "201" + - Scenario: moving a file - Given As an "admin" - And user "user0" exists - When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" - Then the HTTP status code should be "201" From 69a03c2e60fce7e64baac1659af71cb4b0af0d76 Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Fri, 20 Nov 2015 11:56:05 +0000 Subject: [PATCH 7/7] Added test case about trying to reshare a file with more permissions --- build/integration/features/sharing-v1.feature | 19 +++++++++++++++++++ .../features/webdav-related.feature | 18 +++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 33085866bf4..063a40b1d3c 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -333,6 +333,25 @@ Feature: sharing Then the OCS status code should be "404" And the HTTP status code should be "200" + Scenario: User is not allowed to reshare file with more permissions + As an "admin" + Given user "user0" exists + And user "user1" exists + And user "user2" exists + And As an "user0" + And creating a share with + | path | /textfile0.txt | + | shareType | 0 | + | shareWith | user1 | + | permissions | 16 | + And As an "user1" + When creating a share with + | path | /textfile0. (2).txt | + | shareType | 0 | + | shareWith | user2 | + | permissions | 31 | + Then the OCS status code should be "404" + And the HTTP status code should be "200" Scenario: Delete all group shares Given As an "admin" diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature index 27d354644d0..961b6b03431 100644 --- a/build/integration/features/webdav-related.feature +++ b/build/integration/features/webdav-related.feature @@ -1,13 +1,13 @@ Feature: sharing - Background: - Given using api version "1" - - Scenario: moving a file old way - Given using dav path "remote.php/webdav" - And As an "admin" - And user "user0" exists - When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" - Then the HTTP status code should be "201" + Background: + Given using api version "1" + + Scenario: moving a file old way + Given using dav path "remote.php/webdav" + And As an "admin" + And user "user0" exists + When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" + Then the HTTP status code should be "201"