From b0a3b2572454b9da0e48fa39d5a967d5b02fef94 Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Thu, 24 Nov 2016 14:13:58 +0000 Subject: [PATCH] Added functionaly for not shared elements Signed-off-by: Lukas Reschke --- build/integration/features/bootstrap/TagsContext.php | 8 ++++---- build/integration/features/tags.feature | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build/integration/features/bootstrap/TagsContext.php b/build/integration/features/bootstrap/TagsContext.php index 91fb585d64..46ce869c86 100644 --- a/build/integration/features/bootstrap/TagsContext.php +++ b/build/integration/features/bootstrap/TagsContext.php @@ -516,13 +516,13 @@ class TagsContext implements \Behat\Behat\Context\Context { } /** - * @When :taggingUser adds the tag :tagName to :fileName shared by :sharingUser + * @When /^"([^"]*)" adds the tag "([^"]*)" to "([^"]*)" (shared|owned) by "([^"]*)"$/ * @param string $taggingUser * @param string $tagName * @param string $fileName * @param string $sharingUser */ - public function addsTheTagToSharedBy($taggingUser, $tagName, $fileName, $sharingUser) { + public function addsTheTagToSharedBy($taggingUser, $tagName, $fileName, $sharedOrOwnedBy, $sharingUser) { $fileId = $this->getFileIdForPath($fileName, $sharingUser); $tagId = $this->findTagIdByName($tagName); @@ -542,13 +542,13 @@ class TagsContext implements \Behat\Behat\Context\Context { } /** - * @Then :fileName shared by :sharingUser has the following tags + * @Then /^"([^"]*)" (shared|owned) by "([^"]*)" has the following tags$/ * @param string $fileName * @param string $sharingUser * @param TableNode $table * @throws \Exception */ - public function sharedByHasTheFollowingTags($fileName, $sharingUser, TableNode $table) { + public function sharedByHasTheFollowingTags($fileName, $sharedOrOwnedBy, $sharingUser, TableNode $table) { $loadedExpectedTags = $table->getTable(); $expectedTags = []; foreach($loadedExpectedTags as $expected) { diff --git a/build/integration/features/tags.feature b/build/integration/features/tags.feature index d793c0d3c6..3578441908 100644 --- a/build/integration/features/tags.feature +++ b/build/integration/features/tags.feature @@ -425,3 +425,12 @@ Feature: tags Then The response should have a status code "201" And the user "user0" cannot assign the "not user-assignable" tag with name "TagWithGroups" + Scenario: Assign a normal tag to a file + Given user "user0" exists + And "admin" creates a "normal" tag with name "Etiqueta" + And As an "user0" + When "user0" adds the tag "Etiqueta" to "/textfile0.txt" owned by "user0" + Then The response should have a status code "201" + And "textfile0.txt" owned by "user0" has the following tags + | Etiqueta | +