Added functionaly for not shared elements

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Sergio Bertolin 2016-11-24 14:13:58 +00:00 committed by Lukas Reschke
parent fbbd833ed1
commit b0a3b25724
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1
2 changed files with 13 additions and 4 deletions

View file

@ -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) {

View file

@ -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 |