123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- Feature: tags
- Scenario: Creating a normal tag as regular user should work
- Given user "user0" exists
- When "user0" creates a "normal" tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "201"
- And The following tags should exist for "admin"
- |MySuperAwesomeTagName|true|true|
- And The following tags should exist for "user0"
- |MySuperAwesomeTagName|true|true|
- Scenario: Creating a not user-assignable tag as regular user should fail
- Given user "user0" exists
- When "user0" creates a "not user-assignable" tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "400"
- And "0" tags should exist for "admin"
- Scenario: Creating a not user-visible tag as regular user should fail
- Given user "user0" exists
- When "user0" creates a "not user-visible" tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "400"
- And "0" tags should exist for "admin"
- Scenario: Creating a not user-assignable tag with groups as admin should work
- Given user "user0" exists
- When "admin" creates a "not user-assignable" tag with name "TagWithGroups" and groups "group1|group2"
- Then The response should have a status code "201"
- And The "not user-assignable" tag with name "TagWithGroups" has the groups "group1|group2"
- Scenario: Creating a normal tag with groups as regular user should fail
- Given user "user0" exists
- When "user0" creates a "normal" tag with name "MySuperAwesomeTagName" and groups "group1|group2"
- Then The response should have a status code "400"
- And "0" tags should exist for "user0"
- Scenario: Renaming a normal tag as regular user should work
- Given user "user0" exists
- Given "admin" creates a "normal" tag with name "MySuperAwesomeTagName"
- When "user0" edits the tag with name "MySuperAwesomeTagName" and sets its name to "AnotherTagName"
- Then The response should have a status code "207"
- And The following tags should exist for "admin"
- |AnotherTagName|true|true|
- Scenario: Renaming a not user-assignable tag as regular user should fail
- Given user "user0" exists
- Given "admin" creates a "not user-assignable" tag with name "MySuperAwesomeTagName"
- When "user0" edits the tag with name "MySuperAwesomeTagName" and sets its name to "AnotherTagName"
- Then The response should have a status code "403"
- And The following tags should exist for "admin"
- |MySuperAwesomeTagName|true|false|
- Scenario: Renaming a not user-visible tag as regular user should fail
- Given user "user0" exists
- Given "admin" creates a "not user-visible" tag with name "MySuperAwesomeTagName"
- When "user0" edits the tag with name "MySuperAwesomeTagName" and sets its name to "AnotherTagName"
- Then The response should have a status code "404"
- And The following tags should exist for "admin"
- |MySuperAwesomeTagName|false|true|
- Scenario: Editing tag groups as admin should work
- Given user "user0" exists
- Given "admin" creates a "not user-assignable" tag with name "TagWithGroups" and groups "group1|group2"
- When "admin" edits the tag with name "TagWithGroups" and sets its groups to "group1|group3"
- Then The response should have a status code "207"
- And The "not user-assignable" tag with name "TagWithGroups" has the groups "group1|group3"
- Scenario: Editing tag groups as regular user should fail
- Given user "user0" exists
- Given "admin" creates a "not user-assignable" tag with name "TagWithGroups"
- When "user0" edits the tag with name "TagWithGroups" and sets its groups to "group1|group3"
- Then The response should have a status code "403"
- Scenario: Deleting a normal tag as regular user should fail
- Given user "user0" exists
- Given "admin" creates a "normal" tag with name "MySuperAwesomeTagName"
- When "user0" deletes the tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "403"
- And The following tags should exist for "admin"
- |MySuperAwesomeTagName|true|true|
- Scenario: Deleting a not user-assignable tag as regular user should fail
- Given user "user0" exists
- Given "admin" creates a "not user-assignable" tag with name "MySuperAwesomeTagName"
- When "user0" deletes the tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "403"
- And The following tags should exist for "admin"
- |MySuperAwesomeTagName|true|false|
- Scenario: Deleting a not user-visible tag as regular user should fail
- Given user "user0" exists
- Given "admin" creates a "not user-visible" tag with name "MySuperAwesomeTagName"
- When "user0" deletes the tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "404"
- And The following tags should exist for "admin"
- |MySuperAwesomeTagName|false|true|
- Scenario: Deleting a normal tag as admin should work
- Given "admin" creates a "normal" tag with name "MySuperAwesomeTagName"
- When "admin" deletes the tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "204"
- And "0" tags should exist for "admin"
- Scenario: Deleting a not user-assignable tag as admin should work
- Given "admin" creates a "not user-assignable" tag with name "MySuperAwesomeTagName"
- When "admin" deletes the tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "204"
- And "0" tags should exist for "admin"
- Scenario: Deleting a not user-visible tag as admin should work
- Given "admin" creates a "not user-visible" tag with name "MySuperAwesomeTagName"
- When "admin" deletes the tag with name "MySuperAwesomeTagName"
- Then The response should have a status code "204"
- And "0" tags should exist for "admin"
- Scenario: Assigning a normal tag to a file shared by someone else as regular user should work
- Given user "user0" exists
- Given user "12345" exists
- Given "admin" creates a "normal" tag with name "MySuperAwesomeTagName"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | 12345 |
- | shareType | 0 |
- Given user "12345" accepts last share
- When "12345" adds the tag "MySuperAwesomeTagName" to "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "201"
- And "/myFileToTag.txt" shared by "user0" has the following tags
- |MySuperAwesomeTagName|
- Scenario: Assigning a normal tag to a file belonging to someone else as regular user should fail
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "normal" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- When "user1" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "404"
- And "/myFileToTag.txt" shared by "user0" has the following tags
- |MyFirstTag|
- Scenario: Assigning a not user-assignable tag to a file shared by someone else as regular user should fail
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "normal" tag with name "MyFirstTag"
- Given "admin" creates a "not user-assignable" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- When "user1" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "403"
- And "/myFileToTag.txt" shared by "user0" has the following tags
- |MyFirstTag|
- Scenario: Assigning a not user-assignable tag to a file shared by someone else as regular user belongs to tag's groups should work
- Given user "user0" exists
- Given user "user1" exists
- Given group "group1" exists
- Given user "user1" belongs to group "group1"
- Given "admin" creates a "not user-assignable" tag with name "MySuperAwesomeTagName" and groups "group1"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- When "user1" adds the tag "MySuperAwesomeTagName" to "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "201"
- And "/myFileToTag.txt" shared by "user0" has the following tags
- |MySuperAwesomeTagName|
- Scenario: Assigning a not user-visible tag to a file shared by someone else as regular user should fail
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "normal" tag with name "MyFirstTag"
- Given "admin" creates a "not user-visible" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- When "user1" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "412"
- And "/myFileToTag.txt" shared by "user0" has the following tags
- |MyFirstTag|
- Scenario: Assigning a not user-visible tag to a file shared by someone else as admin user should work
- Given user "user0" exists
- Given "admin" creates a "normal" tag with name "MyFirstTag"
- Given "admin" creates a "not user-visible" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | admin |
- | shareType | 0 |
- Given user "admin" accepts last share
- When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- When "admin" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "201"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
- |MyFirstTag|
- |MySecondTag|
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MyFirstTag|
- Scenario: Assigning a not user-assignable tag to a file shared by someone else as admin user should worj
- Given user "user0" exists
- Given "admin" creates a "normal" tag with name "MyFirstTag"
- Given "admin" creates a "not user-assignable" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | admin |
- | shareType | 0 |
- Given user "admin" accepts last share
- When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- When "admin" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "201"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
- |MyFirstTag|
- |MySecondTag|
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MyFirstTag|
- |MySecondTag|
- Scenario: Unassigning a normal tag from a file shared by someone else as regular user should work
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "normal" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- Given "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- When "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "204"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MySecondTag|
- Scenario: Unassigning a normal tag from a file unshared by someone else as regular user should fail
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "normal" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- When "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "404"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MyFirstTag|
- |MySecondTag|
- Scenario: Unassigning a not user-visible tag from a file shared by someone else as regular user should fail
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "not user-visible" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | admin |
- | shareType | 0 |
- Given user "admin" accepts last share
- Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- When "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "404"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MySecondTag|
- And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
- |MyFirstTag|
- |MySecondTag|
- Scenario: Unassigning a not user-visible tag from a file shared by someone else as admin should work
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "not user-visible" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | admin |
- | shareType | 0 |
- Given user "admin" accepts last share
- Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- When "admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "204"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MySecondTag|
- And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
- |MySecondTag|
- Scenario: Unassigning a not user-visible tag from a file unshared by someone else should fail
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "not user-visible" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | admin |
- | shareType | 0 |
- Given user "admin" accepts last share
- Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- Given As "user0" remove all shares from the file named "/myFileToTag.txt"
- When "admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "404"
- Scenario: Unassigning a not user-assignable tag from a file shared by someone else as regular user should fail
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "not user-assignable" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | admin |
- | shareType | 0 |
- Given user "admin" accepts last share
- Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- When "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "403"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MyFirstTag|
- |MySecondTag|
- And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
- |MyFirstTag|
- |MySecondTag|
- Scenario: Unassigning a not user-assignable tag from a file shared by someone else as admin should work
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "not user-assignable" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | admin |
- | shareType | 0 |
- Given user "admin" accepts last share
- Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- When "admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "204"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MySecondTag|
- And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
- |MySecondTag|
- Scenario: Unassigning a not user-assignable tag from a file unshared by someone else should fail
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "not user-assignable" tag with name "MyFirstTag"
- Given "admin" creates a "normal" tag with name "MySecondTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given user "user1" accepts last share
- Given as "user0" creating a share with
- | path | myFileToTag.txt |
- | shareWith | admin |
- | shareType | 0 |
- Given user "admin" accepts last share
- Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
- Given As "user0" remove all shares from the file named "/myFileToTag.txt"
- When "admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
- Then The response should have a status code "404"
- Scenario: Overwriting existing normal tags should fail
- Given user "user0" exists
- Given "user0" creates a "normal" tag with name "MyFirstTag"
- When "user0" creates a "normal" tag with name "MyFirstTag"
- Then The response should have a status code "409"
- Scenario: Overwriting existing not user-assignable tags should fail
- Given "admin" creates a "not user-assignable" tag with name "MyFirstTag"
- When "admin" creates a "not user-assignable" tag with name "MyFirstTag"
- Then The response should have a status code "409"
- Scenario: Overwriting existing not user-visible tags should fail
- Given "admin" creates a "not user-visible" tag with name "MyFirstTag"
- When "admin" creates a "not user-visible" tag with name "MyFirstTag"
- Then The response should have a status code "409"
- Scenario: Getting tags only works with access to the file
- Given user "user0" exists
- Given user "user1" exists
- Given "admin" creates a "normal" tag with name "MyFirstTag"
- Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
- When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
- |MyFirstTag|
- And "/myFileToTag.txt" shared by "user0" has the following tags for "user1"
- ||
- And The response should have a status code "404"
- Scenario: User can assign tags when in the tag's groups
- Given user "user0" exists
- Given group "group1" exists
- Given user "user0" belongs to group "group1"
- When "admin" creates a "not user-assignable" tag with name "TagWithGroups" and groups "group1|group2"
- Then The response should have a status code "201"
- And the user "user0" can assign the "not user-assignable" tag with name "TagWithGroups"
- Scenario: User cannot assign tags when not in the tag's groups
- Given user "user0" exists
- When "admin" creates a "not user-assignable" tag with name "TagWithGroups" and groups "group1|group2"
- 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 |
|