/
admin_works.feature
348 lines (324 loc) · 14.2 KB
/
admin_works.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
@admin
Feature: Admin Actions for Works, Comments, Series, Bookmarks
As an admin
I should be able to perform special actions
Scenario: Can troubleshoot works
Given I am logged in as "regular_user"
And I post the work "Just a work you know"
When I am logged in as a "support" admin
And I view the work "Just a work you know"
And I follow "Troubleshoot"
And I check "Reindex Work"
And I press "Troubleshoot"
Then I should see "Work sent to be reindexed."
Scenario: Can hide works
Given I am logged in as "regular_user"
And I post the work "ToS Violation"
When I am logged in as a "policy_and_abuse" admin
And I view the work "ToS Violation"
And I follow "Hide Work"
Then I should see "Item has been hidden."
And logged out users should not see the hidden work "ToS Violation" by "regular_user"
And logged in users should not see the hidden work "ToS Violation" by "regular_user"
And "regular_user" should see their work "ToS Violation" is hidden
And 1 email should be delivered
And the email should contain "We are investigating the matter and will contact you"
Scenario: Can unhide works
Given I am logged in as "regular_user"
And I post the work "ToS Violation"
When I am logged in as a "policy_and_abuse" admin
And I view the work "ToS Violation"
And I follow "Hide Work"
And all indexing jobs have been run
Then I should see "Item has been hidden."
And all emails have been delivered
When I follow "Make Work Visible"
And all indexing jobs have been run
Then I should see "Item is no longer hidden."
And logged out users should see the unhidden work "ToS Violation" by "regular_user"
And logged in users should see the unhidden work "ToS Violation" by "regular_user"
And 0 emails should be delivered
Scenario: Can delete works
Given I am logged in as "regular_user"
And I post the work "ToS Violation"
When I am logged in as a "policy_and_abuse" admin
And I view the work "ToS Violation"
And I follow "Delete Work"
And all indexing jobs have been run
Then I should see "Item was successfully deleted."
And 1 email should be delivered
And the email should contain "deleted from the Archive by a site admin"
And the email should not contain "translation missing"
When I am logged out
And I am on regular_user's works page
Then I should not see "ToS Violation"
When I am logged in
And I am on regular_user's works page
Then I should not see "ToS Violation"
Scenario: Can hide bookmarks
Given basic tags
And I am logged in as "regular_user" with password "password1"
And I post the work "A Nice Work"
When I am logged in as "bad_user"
And I view the work "A Nice Work"
When I follow "Bookmark"
And I fill in "bookmark_notes" with "Rude comment"
And I press "Create"
And all indexing jobs have been run
Then I should see "Bookmark was successfully created"
When I am logged in as a "policy_and_abuse" admin
And I am on bad_user's bookmarks page
When I follow "Hide Bookmark"
And all indexing jobs have been run
Then I should see "Item has been hidden."
When I am logged in as "regular_user" with password "password1"
And I am on bad_user's bookmarks page
Then I should not see "Rude comment"
Scenario: Can edit tags on works
Given basic tags
And I am logged in as "regular_user"
And I post the work "Changes" with fandom "User-Added Fandom" with freeform "User-Added Freeform" with category "M/M"
When I am logged in as a "policy_and_abuse" admin
And I view the work "Changes"
And I follow "Edit Tags and Language"
When I select "Mature" from "Rating"
And I uncheck "No Archive Warnings Apply"
And I check "Choose Not To Use Archive Warnings"
And I fill in "Fandoms" with "Admin-Added Fandom"
And I fill in "Relationships" with "Admin-Added Relationship"
And I fill in "Characters" with "Admin-Added Character"
And I fill in "Additional Tags" with "Admin-Added Freeform"
And I uncheck "M/M"
And I check "Other"
When I press "Post"
Then I should not see "User-Added Fandom"
And I should see "Admin-Added Fandom"
And I should not see "User-Added Freeform"
And I should see "Admin-Added Freeform"
And I should not see "M/M"
And I should see "Other"
And I should not see "No Archive Warnings Apply"
And I should see "Creator Chose Not To Use Archive Warnings"
And I should not see "Not Rated"
And I should see "Mature"
And I should see "Admin-Added Relationship"
And I should see "Admin-Added Character"
When I follow "Activities"
Then I should see "View Admin Activity"
When I visit the last activities item
Then I should see "No Archive Warnings Apply"
And I should see "Old tags"
And I should see "User-Added Fandom"
And I should not see "Admin-Added Fandom"
Scenario: Can edit external works
Given basic tags
And I am logged in as "regular_user"
And I bookmark the external work "External Changes"
When I am logged in as a "policy_and_abuse" admin
And I view the external work "External Changes"
And I follow "Edit External Work"
When I fill in "Creator" with "Admin-Added Creator"
And I fill in "Title" with "Admin-Added Title"
And I fill in "Creator's Summary" with "Admin-added summary"
And I select "Mature" from "Rating"
And I check "No Archive Warnings Apply"
And I fill in "Fandoms" with "Admin-Added Fandom"
And I fill in "Relationships" with "Admin-Added Relationship"
And I fill in "Characters" with "Admin-Added Character"
And I fill in "Additional Tags" with "Admin-Added Freeform"
And I check "M/M"
When I press "Update External work"
Then I should see "Admin-Added Creator"
And I should see "Admin-Added Title"
And I should see "Admin-added summary"
And I should see "Mature"
And I should see "No Archive Warnings"
And I should see "Admin-Added Fandom"
And I should see "Admin-Added Character"
And I should see "Admin-Added Freeform"
And I should see "M/M"
Scenario: Can delete external works
Given basic tags
And I am logged in as "regular_user"
And I bookmark the external work "External Changes"
When I am logged in as a "policy_and_abuse" admin
And I view the external work "External Changes"
And I follow "Delete External Work"
Then I should see "Item was successfully deleted."
Scenario: Can mark a comment as spam
Given I have no works or comments
And the following activated users exist
| login | password |
| author | password |
| commenter | password |
# set up a work with a genuine comment
When I am logged in as "author" with password "password"
And I post the work "The One Where Neal is Awesome"
When I am logged out
And I am logged in as "commenter" with password "password"
And I view the work "The One Where Neal is Awesome"
And I fill in "Comment" with "I loved this!"
And I press "Comment"
Then I should see "Comment created!"
When I am logged out
# comment from registered user cannot be marked as spam.
# If registered user is spamming, this goes to Abuse team as ToS violation
When I am logged in as a "policy_and_abuse" admin
Then I should see "Successfully logged in"
When I view the work "The One Where Neal is Awesome"
And I follow "Comments (1)"
Then I should not see "Spam" within "#feedback"
# now mark a comment as spam
When I post the comment "Would you like a genuine rolex" on the work "The One Where Neal is Awesome" as a guest
And I am logged in as a "policy_and_abuse" admin
And I view the work "The One Where Neal is Awesome"
And I follow "Comments (2)"
Then I should see "rolex"
And I should see "Spam" within "#feedback"
When I follow "Spam" within "#feedback"
# Can see link to unmark
Then I should see "Not Spam"
And I should see "Hide Comments (1)"
# Admin can still see spam comment
And I should see "rolex"
And I should see "This comment has been marked as spam."
# proper content should still be there
And I should see "I loved this!"
# user can't see spam comment
When I am logged out as an admin
And I view the work "The One Where Neal is Awesome"
Then I should see "Comments (1)"
When I follow "Comments (1)"
Then I should not see "rolex"
And I should see "I loved this!"
# author can't see spam comment
When I am logged in as "author" with password "password"
And I view the work "The One Where Neal is Awesome"
Then I should see "Comments (1)"
When I follow "Comments (1)"
Then I should not see "rolex"
And I should see "I loved this!"
# now mark comment as not spam
When I am logged in as a "policy_and_abuse" admin
And I view the work "The One Where Neal is Awesome"
And I follow "Comments (1)"
And I follow "Not Spam"
Then I should see "Hide Comments (2)"
And I should not see "Not Spam"
And I should not see "This comment has been marked as spam."
# user can see comment again
When I am logged out as an admin
And I view the work "The One Where Neal is Awesome"
Then I should see "Comments (2)"
When I follow "Comments (2)"
Then I should see "rolex"
And I should not see "This comment has been marked as spam."
# author can see comment again
When I am logged in as "author" with password "password"
And I view the work "The One Where Neal is Awesome"
Then I should see "Comments (2)"
When I follow "Comments (2)"
Then I should see "rolex"
And I should not see "This comment has been marked as spam."
Scenario: Admin can edit language on works when posting without previewing
Given basic tags
And basic languages
And I am logged in as "regular_user"
And I post the work "Wrong Language"
When I am logged in as a "policy_and_abuse" admin
And I view the work "Wrong Language"
And I follow "Edit Tags and Language"
Then I should see "Edit Work Tags and Language for "
When I select "Deutsch" from "Choose a language"
And I press "Post"
Then I should see "Deutsch"
And I should not see "English"
Scenario: Admin can edit language on works when previewing first
Given basic tags
And basic languages
And I am logged in as "regular_user"
And I post the work "Wrong Language"
When I am logged in as a "policy_and_abuse" admin
And I view the work "Wrong Language"
And I follow "Edit Tags and Language"
When I select "Deutsch" from "Choose a language"
And I press "Preview"
Then I should see "Preview Tags and Language"
When I press "Update"
Then I should see "Deutsch"
And I should not see "English"
Scenario: can mark a work as spam
Given the work "Spammity Spam"
And I am logged in as a "policy_and_abuse" admin
And I view the work "Spammity Spam"
Then I should see "Mark As Spam"
When I follow "Mark As Spam"
Then I should see "marked as spam and hidden"
And I should see "Mark Not Spam"
And the work "Spammity Spam" should be marked as spam
And the work "Spammity Spam" should be hidden
Scenario: can mark a spam work as not-spam
Given the spam work "Spammity Spam"
And I am logged in as a "policy_and_abuse" admin
And I view the work "Spammity Spam"
Then I should see "Mark Not Spam"
When I follow "Mark Not Spam"
Then I should see "marked not spam and unhidden"
And I should see "Mark As Spam"
And the work "Spammity Spam" should not be marked as spam
And the work "Spammity Spam" should not be hidden
Scenario: Admin can hide a series (e.g. if the series description or notes contain a TOS Violation)
Given I am logged in as "tosser"
And I add the work "Legit Work" to series "Violation"
When I am logged in as a "policy_and_abuse" admin
And I view the series "Violation"
And I follow "Hide Series"
Then I should see "Item has been hidden."
And I should see the image "title" text "Hidden by Administrator"
And I should see "Make Series Visible"
When I am logged out
And I go to tosser's series page
Then I should see "Series (0)"
And I should not see "Violation"
When I view the series "Violation"
Then I should see "Sorry, you don't have permission to access the page you were trying to reach."
When I am logged in as "other_user"
And I go to tosser's series page
Then I should see "Series (0)"
And I should not see "Violation"
When I view the series "Violation"
Then I should see "Sorry, you don't have permission to access the page you were trying to reach."
When I am logged in as "tosser"
And I go to tosser's series page
Then I should see "Series (0)"
And I should not see "Violation"
When I view the series "Violation"
Then I should see the image "title" text "Hidden by Administrator"
Scenario: Admin can un-hide a series
Given I am logged in as "tosser"
And I add the work "Legit Work" to series "Violation"
And I am logged in as a "policy_and_abuse" admin
And I view the series "Violation"
And I follow "Hide Series"
When I follow "Make Series Visible"
Then I should see "Item is no longer hidden."
And I should not see the image "title" text "Hidden by Administrator"
And I should see "Hide Series"
When I am logged out
And I go to tosser's series page
Then I should see "Series (1)"
And I should see "Violation"
When I view the series "Violation"
Then I should see "Violation"
When I am logged in as "other_user"
And I go to tosser's series page
Then I should see "Series (1)"
And I should see "Violation"
When I view the series "Violation"
Then I should see "Violation"
When I am logged in as "tosser"
And I go to tosser's series page
Then I should see "Series (1)"
And I should see "Violation"
When I view the series "Violation"
Then I should see "Violation"