-
Notifications
You must be signed in to change notification settings - Fork 524
/
Copy pathwork_create.feature
executable file
·394 lines (375 loc) · 18.7 KB
/
work_create.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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
@works @tags
Feature: Create Works
In order to have an archive full of works
As an author
I want to create new works
Scenario: You can't create a work unless you're logged in
When I go to the new work page
Then I should see "Please log in"
Scenario: Creating a new minimally valid work
Given basic tags
And I am logged in as "newbie"
When I go to the new work page
Then I should see "Post New Work"
And I select "Not Rated" from "Rating"
And I check "No Archive Warnings Apply"
And I fill in "Fandoms" with "Supernatural"
And I fill in "Work Title" with "All Hell Breaks Loose 🤬💩"
And I fill in "content" with "Bad things happen, etc. 🤬💩"
When I press "Preview"
Then I should see "Preview"
When I press "Post"
Then I should see "Work was successfully posted."
And I should see "Bad things happen, etc. 🤬💩"
When I go to the works page
Then I should see "All Hell Breaks Loose 🤬💩"
Scenario: Creating a new minimally valid work and posting without preview
Given I am logged in as "newbie"
When I set up the draft "All Hell Breaks Loose"
And I fill in "content" with "Bad things happen, etc."
And I press "Post Without Preview"
Then I should see "Work was successfully posted."
And I should see "Bad things happen, etc."
When I go to the works page
Then I should see "All Hell Breaks Loose"
Scenario: Creating a new minimally valid work when you have more than one pseud
Given I am logged in as "newbie"
And "newbie" creates the pseud "Pointless Pseud"
When I set up the draft "All Hell Breaks Loose"
And I unselect "newbie" from "Creator/Pseud(s)"
And I select "Pointless Pseud" from "Creator/Pseud(s)"
And I press "Post Without Preview"
Then I should see "Work was successfully posted."
When I go to the works page
Then I should see "All Hell Breaks Loose"
And I should see "by Pointless Pseud"
@javascript
Scenario: Creating a new work with everything filled in, and we do mean everything
Given basic tags
And the following activated users exist
| login | email |
| coauthor | [email protected] |
| cosomeone | [email protected] |
| giftee | [email protected] |
| recipient | [email protected] |
And the user "coauthor" allows co-creators
And the user "cosomeone" allows co-creators
And I have a collection "Collection 1" with name "collection1"
And I have a collection "Collection 2" with name "collection2"
And I am logged in as "thorough"
And "thorough" creates the pseud "Pseud2"
And "thorough" creates the pseud "Pseud3"
And all emails have been delivered
When I go to the new work page
And I select "Not Rated" from "Rating"
And I check "No Archive Warnings Apply"
And I check "F/M"
And I fill in "Fandoms" with "Supernatural"
And I fill in "Work Title" with "All Something Breaks Loose"
And I fill in "content" with "Bad things happen, etc."
And I check "at the beginning"
And I fill in "Notes" with "This is my beginning note"
And I fill in "End Notes" with "This is my endingnote"
And I fill in "Summary" with "Have a short summary"
And I fill in "Characters" with "Sam Winchester, Dean Winchester,"
And I fill in "Relationships" with "Harry/Ginny"
And I fill in "Additional Tags" with "An extra tag"
And I fill in "Gift this work to" with "Someone else, recipient"
And I check "This work is part of a series"
And I fill in "Or create and use a new one:" with "My new series"
And I select "Pseud2" from "Creator/Pseud(s)"
And I select "Pseud3" from "Creator/Pseud(s)"
And I fill in "pseud_byline" with "coauthor"
And I fill in "Post to Collections / Challenges" with "collection1, collection2"
And I press "Preview"
Then I should see "Draft was successfully created"
When I press "Post"
Then I should see "Work was successfully posted."
And 1 email should be delivered to "[email protected]"
And the email should contain "The user thorough has invited your pseud coauthor to be listed as a co-creator on the following work"
And the email should not contain "translation missing"
And 1 email should be delivered to "[email protected]"
And the email should contain "A gift work has been posted for you"
When I go to the works page
Then I should see "All Something Breaks Loose"
When I follow "All Something Breaks Loose"
Then I should see "All Something Breaks Loose"
And I should see "Fandom: Supernatural"
And I should see "Rating: Not Rated"
And I should see "No Archive Warnings Apply"
And I should not see "Choose Not To Use Archive Warnings"
And I should see "Category: F/M"
And I should see "Characters: Sam Winchester, Dean Winchester"
And I should see "Relationship: Harry/Ginny"
And I should see "Additional Tags: An extra tag"
And I should see "For Someone else, recipient"
And I should see "Collections: Collection 1, Collection 2"
And I should see "Notes"
And I should see "This is my beginning note"
And I should see "See the end of the work for more notes"
And I should see "This is my endingnote"
And I should see "Summary"
And I should see "Have a short summary"
And I should see "My new series"
And I should see "Bad things happen, etc."
And I should see "Pseud2" within ".byline"
And I should see "Pseud3" within ".byline"
But I should not see "coauthor" within ".byline"
When the user "coauthor" accepts all creator invites
And I view the work "All Something Breaks Loose"
Then I should see "coauthor" within ".byline"
When I follow "Add Chapter"
And I fill in "Chapter Title" with "This is my second chapter"
And I fill in "content" with "Let's write another story"
And I press "Preview"
Then I should see "Chapter 2: This is my second chapter"
And I should see "Let's write another story"
When I press "Post"
Then I should see "All Something Breaks Loose"
And I should not see "Bad things happen, etc."
And I should see "Let's write another story"
When I follow "Previous Chapter"
And I should see "Bad things happen, etc."
When I follow "Entire Work"
Then I should see "Bad things happen, etc."
And I should see "Let's write another story"
When I follow "Edit"
And I check "Add co-creators?"
And I fill in "pseud_byline" with "Does_not_exist"
And I press "Preview"
Then I should see "Invalid creator: Could not find a pseud Does_not_exist."
When all emails have been delivered
And I choose "cosomeone" from the "pseud_byline_autocomplete" autocomplete
And I press "Preview"
And I press "Update"
Then I should see "Work was successfully updated"
And I should see "coauthor" within ".byline"
And I should see "Pseud2" within ".byline"
And I should see "Pseud3" within ".byline"
But I should not see "cosomeone" within ".byline"
And 1 email should be delivered to "[email protected]"
When the user "cosomeone" accepts all creator invites
And I view the work "All Something Breaks Loose"
Then I should see "cosomeone" within ".byline"
When all emails have been delivered
And I follow "Edit"
And I give the work to "giftee"
And I press "Preview"
And I press "Update"
Then I should see "Work was successfully updated"
And I should see "For giftee"
And 1 email should be delivered to "[email protected]"
When I go to giftee's user page
Then I should see "Gifts (1)"
Scenario: Creating a new work with some maybe-invalid things
# TODO: needs some more actually invalid things as well
Given basic tags
And the following activated users exist
| login | password | email |
| coauthor | something | [email protected] |
| badcoauthor | something | [email protected] |
And I am logged in as "thorough" with password "something"
And user "badcoauthor" is banned
And the user "coauthor" allows co-creators
When I set up the draft "Bad Draft"
And I fill in "Fandoms" with "Invalid12./"
And I fill in "Work Title" with "/"
And I fill in "content" with "T"
And I check "chapters-options-show"
And I fill in "work_wip_length" with "text"
And I press "Preview"
Then I should see "Brevity is the soul of wit, but your content does have to be at least 10 characters long."
When I fill in "content" with "Text and some longer text"
And I fill in "work_collection_names" with "collection1, collection2"
And I press "Preview"
Then I should see "Sorry! We couldn't save this work because:"
And I should see a collection not found message for "collection1"
# Collections are now parsed by collectible.rb which only shows the first failing collection and nothing else
# And I should see a collection not found message for "collection2"
When I fill in "work_collection_names" with ""
And I fill in "pseud_byline" with "badcoauthor"
And I press "Preview"
Then I should see "badcoauthor is currently banned"
When I fill in "pseud_byline" with "coauthor"
And I fill in "Additional Tags" with "this is a very long tag more than one hundred characters in length how would this normally even be created"
And I press "Preview"
Then I should see "try using less than 100 characters or using commas to separate your tags"
When I fill in "Additional Tags" with "this is a shorter tag"
And I press "Preview"
Then I should see "Draft was successfully created"
And I should see "Chapter"
And I should see "1/?"
Scenario: Creating a new work in a new series with some invalid things should return to the new work page with an error message and the newly created series selected
Given basic tags
And I am logged in as "thorough" with password "something"
When I set up the draft "Bad Draft"
And I fill in "Fandoms" with "Invalid12./"
And I fill in "Work Title" with "/"
And I fill in "content" with "T"
And I check "This work has multiple chapters"
And I fill in "Post to Collections / Challenges" with "collection1, collection2"
And I check "This work is part of a series"
And I fill in "Or create and use a new one:" with "My new series"
And I press "Preview"
Then I should see "Sorry! We couldn't save this work because:"
And I should see a collection not found message for "collection1"
And "My new series" should be selected within "Choose one of your existing series:"
And I should not see "Remove Work From Series"
Scenario: Creating a new work in an existing series with some invalid things should return to the new work page with an error message and series information still filled in
Given basic tags
And I am logged in as "thorough" with password "something"
And I post the work "Work one" as part of a series "My existing series"
When I set up the draft "Bad Draft"
And I fill in "Fandoms" with "Invalid12./"
And I fill in "Work Title" with "/"
And I fill in "content" with "T"
And I check "This work has multiple chapters"
And I fill in "Post to Collections / Challenges" with "collection1, collection2"
And I check "This work is part of a series"
And I select "My existing series" from "Choose one of your existing series:"
And I press "Preview"
Then I should see "Sorry! We couldn't save this work because:"
And I should see a collection not found message for "collection1"
And "My existing series" should be selected within "Choose one of your existing series:"
And I should not see "Remove Work From Series"
Scenario: test for integer title and multiple fandoms
Given I am logged in
When I set up the draft "02138"
And I fill in "Fandoms" with "Supernatural, Smallville"
When I press "Post Without Preview"
Then I should see "Work was successfully posted."
And I should see "Supernatural"
And I should see "Smallville"
And I should see "02138" within "h2.title"
Scenario: test for < and > in title
Given I am logged in
When I set up the draft "4 > 3 and 2 < 5"
When I press "Post Without Preview"
Then I should see "Work was successfully posted."
And I should see "4 > 3 and 2 < 5" within "h2.title"
Scenario: posting a chapter without preview
Given I am logged in as "newbie" with password "password"
And I post the work "All Hell Breaks Loose"
When I follow "Add Chapter"
And I fill in "Chapter Title" with "This is my second chapter"
And I fill in "content" with "Let's write another story"
And I press "Post Without Preview"
Then I should see "Chapter 2: This is my second chapter"
And I should see "Chapter has been posted!"
And I should not see "This is a preview"
Scenario: RTE and HTML buttons are separate
Given the default ratings exist
And I am logged in as "newbie"
When I go to the new work page
Then I should see "Post New Work"
And I should see "Rich Text" within ".rtf-html-switch"
And I should see "HTML" within ".rtf-html-switch"
Scenario: posting a backdated work
Given I am logged in as "testuser" with password "testuser"
And I post the work "This One Stays On Top"
And I set up the draft "Backdated"
And I check "backdate-options-show"
And I select "1" from "work_chapter_attributes_published_at_3i"
And I select "January" from "work_chapter_attributes_published_at_2i"
And I select "1990" from "work_chapter_attributes_published_at_1i"
And I press "Preview"
When I press "Post"
Then I should see "Published:1990-01-01"
When I go to the works page
Then "This One Stays On Top" should appear before "Backdated"
Scenario: Users must set something as a warning and Author Chose Not To Use Archive Warnings should not be added automatically
Given basic tags
And I am logged in
When I go to the new work page
And I fill in "Fandoms" with "Dallas"
And I fill in "Work Title" with "I Shot J.R.: Kristin's Story"
And I fill in "content" with "It wasn't my fault, you know."
And I press "Post Without Preview"
Then I should see "We couldn't save this work"
And I should see "Please add all required tags. Warning is missing."
When I check "No Archive Warnings Apply"
And I press "Post Without Preview"
Then I should see "Work was successfully posted."
And I should see "No Archive Warnings Apply"
And I should not see "Author Chose Not To Use Archive Warnings"
And I should see "It wasn't my fault, you know."
Scenario: Users can co-create a work with a co-creator who has multiple pseuds
Given basic tags
And "myself" has the pseud "Me"
And "herself" has the pseud "Me"
And the user "myself" allows co-creators
And the user "herself" allows co-creators
When I am logged in as "testuser" with password "testuser"
And I go to the new work page
And I fill in the basic work information for "All Hell Breaks Loose"
And I check "Add co-creators?"
And I fill in "pseud_byline" with "Me"
And I check "This work is part of a series"
And I fill in "Or create and use a new one:" with "My new series"
And I press "Post Without Preview"
Then I should see "There's more than one user with the pseud Me."
And I select "myself" from "Please choose the one you want:"
And I press "Preview"
Then I should see "Draft was successfully created."
And I press "Post"
Then I should see "Work was successfully posted. It should appear in work listings within the next few minutes."
And I should not see "Me (myself)"
And I should see "My new series"
When the user "myself" accepts all creator invites
And I view the work "All Hell Breaks Loose"
Then I should see "Me (myself), testuser"
Scenario: Users can only create a work with a co-creator who allows it.
Given basic tags
And "Burnham" has the pseud "Michael"
And "Pike" has the pseud "Christopher"
And the user "Burnham" allows co-creators
When I am logged in as "testuser" with password "testuser"
And I go to the new work page
And I fill in the basic work information for "Thats not my Spock"
And I check "Add co-creators?"
And I fill in "pseud_byline" with "Michael,Christopher"
And I press "Post"
Then I should see "Christopher (Pike) does not allow others to invite them to be a co-creator."
When I fill in "pseud_byline" with "Michael"
And I press "Preview"
Then I should see "Draft was successfully created."
When I press "Post"
Then I should see "Work was successfully posted. It should appear in work listings within the next few minutes."
But I should not see "Michael (Burnham)"
When the user "Burnham" accepts all creator invites
And I view the work "Thats not my Spock"
Then I should see "Michael (Burnham), testuser"
Scenario: Users can't set a publication date that is in the future, e.g. set
the date to April 30 when it is April 26
Given I am logged in
And it is currently Wed Apr 26 22:00:00 UTC 2017
And I set up a draft "Futuristic"
When I check "Set a different publication date"
And I select "30" from "work[chapter_attributes][published_at(3i)]"
And I press "Post Without Preview"
Then I should see "Publication date can't be in the future."
When I jump in our Delorean and return to the present
Scenario: Inviting a co-author adds the co-author to all existing chapters when they accept the invite
Given the user "foobar" exists and is activated
And the user "barbaz" exists and is activated
When I am logged in as "foobar"
And I post the chaptered work "Chaptered Work"
And I edit the work "Chaptered Work"
And I invite the co-author "barbaz"
And I press "Post"
Then I should not see "barbaz"
But 1 email should be delivered to "barbaz"
When I am logged in as "barbaz"
And I view the work "Chaptered Work"
Then I should not see "Edit"
When I follow "Creator Invitations page"
And I check "selected[]"
And I press "Accept"
Then I should see "You are now listed as a co-creator on Chaptered Work."
When I follow "Chaptered Work"
Then I should see "Edit"
And I should see "barbaz, foobar"
And I should not see "Chapter by"
When I follow "Next Chapter"
Then I should see "barbaz, foobar"
And I should not see "Chapter by"