tags.feature 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. Feature: tags
  2. Scenario: Creating a normal tag as regular user should work
  3. Given user "user0" exists
  4. When "user0" creates a "normal" tag with name "MySuperAwesomeTagName"
  5. Then The response should have a status code "201"
  6. And The following tags should exist for "admin"
  7. |MySuperAwesomeTagName|true|true|
  8. And The following tags should exist for "user0"
  9. |MySuperAwesomeTagName|true|true|
  10. Scenario: Creating a not user-assignable tag as regular user should fail
  11. Given user "user0" exists
  12. When "user0" creates a "not user-assignable" tag with name "MySuperAwesomeTagName"
  13. Then The response should have a status code "400"
  14. And "0" tags should exist for "admin"
  15. Scenario: Creating a not user-visible tag as regular user should fail
  16. Given user "user0" exists
  17. When "user0" creates a "not user-visible" tag with name "MySuperAwesomeTagName"
  18. Then The response should have a status code "400"
  19. And "0" tags should exist for "admin"
  20. Scenario: Creating a not user-assignable tag with groups as admin should work
  21. Given user "user0" exists
  22. When "admin" creates a "not user-assignable" tag with name "TagWithGroups" and groups "group1|group2"
  23. Then The response should have a status code "201"
  24. And The "not user-assignable" tag with name "TagWithGroups" has the groups "group1|group2"
  25. Scenario: Creating a normal tag with groups as regular user should fail
  26. Given user "user0" exists
  27. When "user0" creates a "normal" tag with name "MySuperAwesomeTagName" and groups "group1|group2"
  28. Then The response should have a status code "400"
  29. And "0" tags should exist for "user0"
  30. Scenario: Renaming a normal tag as regular user should work
  31. Given user "user0" exists
  32. Given "admin" creates a "normal" tag with name "MySuperAwesomeTagName"
  33. When "user0" edits the tag with name "MySuperAwesomeTagName" and sets its name to "AnotherTagName"
  34. Then The response should have a status code "207"
  35. And The following tags should exist for "admin"
  36. |AnotherTagName|true|true|
  37. Scenario: Renaming a not user-assignable tag as regular user should fail
  38. Given user "user0" exists
  39. Given "admin" creates a "not user-assignable" tag with name "MySuperAwesomeTagName"
  40. When "user0" edits the tag with name "MySuperAwesomeTagName" and sets its name to "AnotherTagName"
  41. Then The response should have a status code "403"
  42. And The following tags should exist for "admin"
  43. |MySuperAwesomeTagName|true|false|
  44. Scenario: Renaming a not user-visible tag as regular user should fail
  45. Given user "user0" exists
  46. Given "admin" creates a "not user-visible" tag with name "MySuperAwesomeTagName"
  47. When "user0" edits the tag with name "MySuperAwesomeTagName" and sets its name to "AnotherTagName"
  48. Then The response should have a status code "404"
  49. And The following tags should exist for "admin"
  50. |MySuperAwesomeTagName|false|true|
  51. Scenario: Editing tag groups as admin should work
  52. Given user "user0" exists
  53. Given "admin" creates a "not user-assignable" tag with name "TagWithGroups" and groups "group1|group2"
  54. When "admin" edits the tag with name "TagWithGroups" and sets its groups to "group1|group3"
  55. Then The response should have a status code "207"
  56. And The "not user-assignable" tag with name "TagWithGroups" has the groups "group1|group3"
  57. Scenario: Editing tag groups as regular user should fail
  58. Given user "user0" exists
  59. Given "admin" creates a "not user-assignable" tag with name "TagWithGroups"
  60. When "user0" edits the tag with name "TagWithGroups" and sets its groups to "group1|group3"
  61. Then The response should have a status code "403"
  62. Scenario: Deleting a normal tag as regular user should fail
  63. Given user "user0" exists
  64. Given "admin" creates a "normal" tag with name "MySuperAwesomeTagName"
  65. When "user0" deletes the tag with name "MySuperAwesomeTagName"
  66. Then The response should have a status code "403"
  67. And The following tags should exist for "admin"
  68. |MySuperAwesomeTagName|true|true|
  69. Scenario: Deleting a not user-assignable tag as regular user should fail
  70. Given user "user0" exists
  71. Given "admin" creates a "not user-assignable" tag with name "MySuperAwesomeTagName"
  72. When "user0" deletes the tag with name "MySuperAwesomeTagName"
  73. Then The response should have a status code "403"
  74. And The following tags should exist for "admin"
  75. |MySuperAwesomeTagName|true|false|
  76. Scenario: Deleting a not user-visible tag as regular user should fail
  77. Given user "user0" exists
  78. Given "admin" creates a "not user-visible" tag with name "MySuperAwesomeTagName"
  79. When "user0" deletes the tag with name "MySuperAwesomeTagName"
  80. Then The response should have a status code "404"
  81. And The following tags should exist for "admin"
  82. |MySuperAwesomeTagName|false|true|
  83. Scenario: Deleting a normal tag as admin should work
  84. Given "admin" creates a "normal" tag with name "MySuperAwesomeTagName"
  85. When "admin" deletes the tag with name "MySuperAwesomeTagName"
  86. Then The response should have a status code "204"
  87. And "0" tags should exist for "admin"
  88. Scenario: Deleting a not user-assignable tag as admin should work
  89. Given "admin" creates a "not user-assignable" tag with name "MySuperAwesomeTagName"
  90. When "admin" deletes the tag with name "MySuperAwesomeTagName"
  91. Then The response should have a status code "204"
  92. And "0" tags should exist for "admin"
  93. Scenario: Deleting a not user-visible tag as admin should work
  94. Given "admin" creates a "not user-visible" tag with name "MySuperAwesomeTagName"
  95. When "admin" deletes the tag with name "MySuperAwesomeTagName"
  96. Then The response should have a status code "204"
  97. And "0" tags should exist for "admin"
  98. Scenario: Assigning a normal tag to a file shared by someone else as regular user should work
  99. Given user "user0" exists
  100. Given user "12345" exists
  101. Given "admin" creates a "normal" tag with name "MySuperAwesomeTagName"
  102. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  103. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  104. | path | myFileToTag.txt |
  105. | shareWith | 12345 |
  106. | shareType | 0 |
  107. When "12345" adds the tag "MySuperAwesomeTagName" to "/myFileToTag.txt" shared by "user0"
  108. Then The response should have a status code "201"
  109. And "/myFileToTag.txt" shared by "user0" has the following tags
  110. |MySuperAwesomeTagName|
  111. Scenario: Assigning a normal tag to a file belonging to someone else as regular user should fail
  112. Given user "user0" exists
  113. Given user "user1" exists
  114. Given "admin" creates a "normal" tag with name "MyFirstTag"
  115. Given "admin" creates a "normal" tag with name "MySecondTag"
  116. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  117. When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  118. When "user1" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  119. Then The response should have a status code "404"
  120. And "/myFileToTag.txt" shared by "user0" has the following tags
  121. |MyFirstTag|
  122. Scenario: Assigning a not user-assignable tag to a file shared by someone else as regular user should fail
  123. Given user "user0" exists
  124. Given user "user1" exists
  125. Given "admin" creates a "normal" tag with name "MyFirstTag"
  126. Given "admin" creates a "not user-assignable" tag with name "MySecondTag"
  127. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  128. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  129. | path | myFileToTag.txt |
  130. | shareWith | user1 |
  131. | shareType | 0 |
  132. When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  133. When "user1" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  134. Then The response should have a status code "403"
  135. And "/myFileToTag.txt" shared by "user0" has the following tags
  136. |MyFirstTag|
  137. Scenario: Assigning a not user-assignable tag to a file shared by someone else as regular user belongs to tag's groups should work
  138. Given user "user0" exists
  139. Given user "user1" exists
  140. Given group "group1" exists
  141. Given user "user1" belongs to group "group1"
  142. Given "admin" creates a "not user-assignable" tag with name "MySuperAwesomeTagName" and groups "group1"
  143. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  144. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  145. | path | myFileToTag.txt |
  146. | shareWith | user1 |
  147. | shareType | 0 |
  148. When "user1" adds the tag "MySuperAwesomeTagName" to "/myFileToTag.txt" shared by "user0"
  149. Then The response should have a status code "201"
  150. And "/myFileToTag.txt" shared by "user0" has the following tags
  151. |MySuperAwesomeTagName|
  152. Scenario: Assigning a not user-visible tag to a file shared by someone else as regular user should fail
  153. Given user "user0" exists
  154. Given user "user1" exists
  155. Given "admin" creates a "normal" tag with name "MyFirstTag"
  156. Given "admin" creates a "not user-visible" tag with name "MySecondTag"
  157. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  158. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  159. | path | myFileToTag.txt |
  160. | shareWith | user1 |
  161. | shareType | 0 |
  162. When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  163. When "user1" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  164. Then The response should have a status code "412"
  165. And "/myFileToTag.txt" shared by "user0" has the following tags
  166. |MyFirstTag|
  167. Scenario: Assigning a not user-visible tag to a file shared by someone else as admin user should work
  168. Given user "user0" exists
  169. Given "admin" creates a "normal" tag with name "MyFirstTag"
  170. Given "admin" creates a "not user-visible" tag with name "MySecondTag"
  171. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  172. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  173. | path | myFileToTag.txt |
  174. | shareWith | admin |
  175. | shareType | 0 |
  176. When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  177. When "admin" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  178. Then The response should have a status code "201"
  179. And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
  180. |MyFirstTag|
  181. |MySecondTag|
  182. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  183. |MyFirstTag|
  184. Scenario: Assigning a not user-assignable tag to a file shared by someone else as admin user should worj
  185. Given user "user0" exists
  186. Given "admin" creates a "normal" tag with name "MyFirstTag"
  187. Given "admin" creates a "not user-assignable" tag with name "MySecondTag"
  188. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  189. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  190. | path | myFileToTag.txt |
  191. | shareWith | admin |
  192. | shareType | 0 |
  193. When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  194. When "admin" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  195. Then The response should have a status code "201"
  196. And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
  197. |MyFirstTag|
  198. |MySecondTag|
  199. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  200. |MyFirstTag|
  201. |MySecondTag|
  202. Scenario: Unassigning a normal tag from a file shared by someone else as regular user should work
  203. Given user "user0" exists
  204. Given user "user1" exists
  205. Given "admin" creates a "normal" tag with name "MyFirstTag"
  206. Given "admin" creates a "normal" tag with name "MySecondTag"
  207. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  208. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  209. | path | myFileToTag.txt |
  210. | shareWith | user1 |
  211. | shareType | 0 |
  212. Given "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  213. Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  214. When "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
  215. Then The response should have a status code "204"
  216. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  217. |MySecondTag|
  218. Scenario: Unassigning a normal tag from a file unshared by someone else as regular user should fail
  219. Given user "user0" exists
  220. Given user "user1" exists
  221. Given "admin" creates a "normal" tag with name "MyFirstTag"
  222. Given "admin" creates a "normal" tag with name "MySecondTag"
  223. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  224. Given "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  225. Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  226. When "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
  227. Then The response should have a status code "404"
  228. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  229. |MyFirstTag|
  230. |MySecondTag|
  231. Scenario: Unassigning a not user-visible tag from a file shared by someone else as regular user should fail
  232. Given user "user0" exists
  233. Given user "user1" exists
  234. Given "admin" creates a "not user-visible" tag with name "MyFirstTag"
  235. Given "admin" creates a "normal" tag with name "MySecondTag"
  236. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  237. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  238. | path | myFileToTag.txt |
  239. | shareWith | user1 |
  240. | shareType | 0 |
  241. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  242. | path | myFileToTag.txt |
  243. | shareWith | admin |
  244. | shareType | 0 |
  245. Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  246. Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  247. When "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
  248. Then The response should have a status code "404"
  249. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  250. |MySecondTag|
  251. And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
  252. |MyFirstTag|
  253. |MySecondTag|
  254. Scenario: Unassigning a not user-visible tag from a file shared by someone else as admin should work
  255. Given user "user0" exists
  256. Given user "user1" exists
  257. Given "admin" creates a "not user-visible" tag with name "MyFirstTag"
  258. Given "admin" creates a "normal" tag with name "MySecondTag"
  259. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  260. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  261. | path | myFileToTag.txt |
  262. | shareWith | user1 |
  263. | shareType | 0 |
  264. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  265. | path | myFileToTag.txt |
  266. | shareWith | admin |
  267. | shareType | 0 |
  268. Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  269. Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  270. When "admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
  271. Then The response should have a status code "204"
  272. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  273. |MySecondTag|
  274. And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
  275. |MySecondTag|
  276. Scenario: Unassigning a not user-visible tag from a file unshared by someone else should fail
  277. Given user "user0" exists
  278. Given user "user1" exists
  279. Given "admin" creates a "not user-visible" tag with name "MyFirstTag"
  280. Given "admin" creates a "normal" tag with name "MySecondTag"
  281. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  282. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  283. | path | myFileToTag.txt |
  284. | shareWith | user1 |
  285. | shareType | 0 |
  286. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  287. | path | myFileToTag.txt |
  288. | shareWith | admin |
  289. | shareType | 0 |
  290. Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  291. Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  292. Given As "user0" remove all shares from the file named "/myFileToTag.txt"
  293. When "admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
  294. Then The response should have a status code "404"
  295. Scenario: Unassigning a not user-assignable tag from a file shared by someone else as regular user should fail
  296. Given user "user0" exists
  297. Given user "user1" exists
  298. Given "admin" creates a "not user-assignable" tag with name "MyFirstTag"
  299. Given "admin" creates a "normal" tag with name "MySecondTag"
  300. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  301. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  302. | path | myFileToTag.txt |
  303. | shareWith | user1 |
  304. | shareType | 0 |
  305. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  306. | path | myFileToTag.txt |
  307. | shareWith | admin |
  308. | shareType | 0 |
  309. Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  310. Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  311. When "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
  312. Then The response should have a status code "403"
  313. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  314. |MyFirstTag|
  315. |MySecondTag|
  316. And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
  317. |MyFirstTag|
  318. |MySecondTag|
  319. Scenario: Unassigning a not user-assignable tag from a file shared by someone else as admin should work
  320. Given user "user0" exists
  321. Given user "user1" exists
  322. Given "admin" creates a "not user-assignable" tag with name "MyFirstTag"
  323. Given "admin" creates a "normal" tag with name "MySecondTag"
  324. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  325. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  326. | path | myFileToTag.txt |
  327. | shareWith | user1 |
  328. | shareType | 0 |
  329. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  330. | path | myFileToTag.txt |
  331. | shareWith | admin |
  332. | shareType | 0 |
  333. Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  334. Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  335. When "admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
  336. Then The response should have a status code "204"
  337. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  338. |MySecondTag|
  339. And "/myFileToTag.txt" shared by "user0" has the following tags for "admin"
  340. |MySecondTag|
  341. Scenario: Unassigning a not user-assignable tag from a file unshared by someone else should fail
  342. Given user "user0" exists
  343. Given user "user1" exists
  344. Given "admin" creates a "not user-assignable" tag with name "MyFirstTag"
  345. Given "admin" creates a "normal" tag with name "MySecondTag"
  346. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  347. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  348. | path | myFileToTag.txt |
  349. | shareWith | user1 |
  350. | shareType | 0 |
  351. Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  352. | path | myFileToTag.txt |
  353. | shareWith | admin |
  354. | shareType | 0 |
  355. Given "admin" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  356. Given "user0" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
  357. Given As "user0" remove all shares from the file named "/myFileToTag.txt"
  358. When "admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0"
  359. Then The response should have a status code "404"
  360. Scenario: Overwriting existing normal tags should fail
  361. Given user "user0" exists
  362. Given "user0" creates a "normal" tag with name "MyFirstTag"
  363. When "user0" creates a "normal" tag with name "MyFirstTag"
  364. Then The response should have a status code "409"
  365. Scenario: Overwriting existing not user-assignable tags should fail
  366. Given "admin" creates a "not user-assignable" tag with name "MyFirstTag"
  367. When "admin" creates a "not user-assignable" tag with name "MyFirstTag"
  368. Then The response should have a status code "409"
  369. Scenario: Overwriting existing not user-visible tags should fail
  370. Given "admin" creates a "not user-visible" tag with name "MyFirstTag"
  371. When "admin" creates a "not user-visible" tag with name "MyFirstTag"
  372. Then The response should have a status code "409"
  373. Scenario: Getting tags only works with access to the file
  374. Given user "user0" exists
  375. Given user "user1" exists
  376. Given "admin" creates a "normal" tag with name "MyFirstTag"
  377. Given user "user0" uploads file "data/textfile.txt" to "/myFileToTag.txt"
  378. When "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0"
  379. And "/myFileToTag.txt" shared by "user0" has the following tags for "user0"
  380. |MyFirstTag|
  381. And "/myFileToTag.txt" shared by "user0" has the following tags for "user1"
  382. ||
  383. And The response should have a status code "404"
  384. Scenario: User can assign tags when in the tag's groups
  385. Given user "user0" exists
  386. Given group "group1" exists
  387. Given user "user0" belongs to group "group1"
  388. When "admin" creates a "not user-assignable" tag with name "TagWithGroups" and groups "group1|group2"
  389. Then The response should have a status code "201"
  390. And the user "user0" can assign the "not user-assignable" tag with name "TagWithGroups"
  391. Scenario: User cannot assign tags when not in the tag's groups
  392. Given user "user0" exists
  393. When "admin" creates a "not user-assignable" tag with name "TagWithGroups" and groups "group1|group2"
  394. Then The response should have a status code "201"
  395. And the user "user0" cannot assign the "not user-assignable" tag with name "TagWithGroups"
  396. Scenario: Assign a normal tag to a file
  397. Given user "user0" exists
  398. And "admin" creates a "normal" tag with name "Etiqueta"
  399. And As an "user0"
  400. When "user0" adds the tag "Etiqueta" to "/textfile0.txt" owned by "user0"
  401. Then The response should have a status code "201"
  402. And "textfile0.txt" owned by "user0" has the following tags
  403. | Etiqueta |