From e0fd1bfccf4ed25c0abbd1fa33735b14ccfef1d9 Mon Sep 17 00:00:00 2001 From: ASalbenblatt Date: Sun, 10 May 2026 15:04:29 -0600 Subject: [PATCH 1/2] Adding tests to ensure related work emails are always sent --- .../step_definitions/work_related_steps.rb | 57 +++++++++++++++++++ features/works/work_related.feature | 23 ++++++++ 2 files changed, 80 insertions(+) diff --git a/features/step_definitions/work_related_steps.rb b/features/step_definitions/work_related_steps.rb index 028504265f6..6b2a4e636f3 100644 --- a/features/step_definitions/work_related_steps.rb +++ b/features/step_definitions/work_related_steps.rb @@ -74,6 +74,63 @@ step %{I press "Post"} end +When /^I post a related work as remixer without previewing it$/ do + step %{I am logged in as "remixer"} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} + step %{I press "Post"} +end + +When /^I post a related work as remixer after saving it as a draft$/ do + step %{I am logged in as "remixer"} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} + step %{I press "Save Draft"} + step %{I press "Post"} +end + +When /^I post a related work as remixer after saving it as a draft and then editing it$/ do + step %{I am logged in as "remixer"} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} + step %{I press "Save Draft"} + step %{I press "Edit"} + step %{I press "Post"} +end + +When /^I post a related work as remixer after previewing it and then editing it$/ do + step %{I am logged in as "remixer"} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} + step %{I press "Preview"} + step %{I press "Edit"} + step %{I press "Post"} +end + When /^I post a related work as remixer for an external work$/ do step %{I am logged in as "remixer"} step %{I go to the new work page} diff --git a/features/works/work_related.feature b/features/works/work_related.feature index b68699c495c..8c35f7ec953 100644 --- a/features/works/work_related.feature +++ b/features/works/work_related.feature @@ -11,6 +11,29 @@ Scenario: Posting a remix / related work emails the creator of the original work Then a parent related work should be seen And the original author should be emailed +Scenario: Posting a remix in a variatey of ways should always send related work emails the creator of the original work and list the parent work in the proper location on the remix / related work + + Given I have related works setup + And all emails have been delivered + When I post a related work as remixer without previewing it + Then a parent related work should be seen + And the original author should be emailed + + Given all emails have been delivered + When I post a related work as remixer after saving it as a draft + Then a parent related work should be seen + And the original author should be emailed + + Given all emails have been delivered + When I post a related work as remixer after saving it as a draft and then editing it + Then a parent related work should be seen + And the original author should be emailed + + Given all emails have been delivered + When I post a related work as remixer after previewing it and then editing it + Then a parent related work should be seen + And the original author should be emailed + Scenario: Remixer can see their remix / related work on their related works page Given I have related works setup From e5a24dfec9eeae44125554187d18f3e6f2456b82 Mon Sep 17 00:00:00 2001 From: ASalbenblatt Date: Sun, 10 May 2026 21:25:14 -0600 Subject: [PATCH 2/2] Fixing indentation and turning regex into cucumber syntax --- .../step_definitions/work_related_steps.rb | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/features/step_definitions/work_related_steps.rb b/features/step_definitions/work_related_steps.rb index 6b2a4e636f3..876ff602867 100644 --- a/features/step_definitions/work_related_steps.rb +++ b/features/step_definitions/work_related_steps.rb @@ -60,74 +60,74 @@ # when for remixes / related works -When /^I post a related work as remixer$/ do +When "I post a related work as remixer" do step %{I am logged in as "remixer"} - step %{I go to the new work page} - step %{I select "Not Rated" from "Rating"} - step %{I check "No Archive Warnings Apply"} - step %{I select "English" from "Choose a language"} - step %{I fill in "Fandoms" with "Stargate"} - step %{I fill in "Work Title" with "Followup"} - step %{I fill in "content" with "That could be an amusing crossover."} - step %{I list the work "Worldbuilding" as inspiration} - step %{I press "Preview"} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} + step %{I press "Preview"} step %{I press "Post"} end -When /^I post a related work as remixer without previewing it$/ do +When "I post a related work as remixer without previewing it" do step %{I am logged in as "remixer"} - step %{I go to the new work page} - step %{I select "Not Rated" from "Rating"} - step %{I check "No Archive Warnings Apply"} - step %{I select "English" from "Choose a language"} - step %{I fill in "Fandoms" with "Stargate"} - step %{I fill in "Work Title" with "Followup"} - step %{I fill in "content" with "That could be an amusing crossover."} - step %{I list the work "Worldbuilding" as inspiration} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} step %{I press "Post"} end -When /^I post a related work as remixer after saving it as a draft$/ do +When "I post a related work as remixer after saving it as a draft" do step %{I am logged in as "remixer"} - step %{I go to the new work page} - step %{I select "Not Rated" from "Rating"} - step %{I check "No Archive Warnings Apply"} - step %{I select "English" from "Choose a language"} - step %{I fill in "Fandoms" with "Stargate"} - step %{I fill in "Work Title" with "Followup"} - step %{I fill in "content" with "That could be an amusing crossover."} - step %{I list the work "Worldbuilding" as inspiration} - step %{I press "Save Draft"} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} + step %{I press "Save Draft"} step %{I press "Post"} end -When /^I post a related work as remixer after saving it as a draft and then editing it$/ do +When "I post a related work as remixer after saving it as a draft and then editing it" do step %{I am logged in as "remixer"} - step %{I go to the new work page} - step %{I select "Not Rated" from "Rating"} - step %{I check "No Archive Warnings Apply"} - step %{I select "English" from "Choose a language"} - step %{I fill in "Fandoms" with "Stargate"} - step %{I fill in "Work Title" with "Followup"} - step %{I fill in "content" with "That could be an amusing crossover."} - step %{I list the work "Worldbuilding" as inspiration} - step %{I press "Save Draft"} - step %{I press "Edit"} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} + step %{I press "Save Draft"} + step %{I press "Edit"} step %{I press "Post"} end -When /^I post a related work as remixer after previewing it and then editing it$/ do +When "I post a related work as remixer after previewing it and then editing it" do step %{I am logged in as "remixer"} - step %{I go to the new work page} - step %{I select "Not Rated" from "Rating"} - step %{I check "No Archive Warnings Apply"} - step %{I select "English" from "Choose a language"} - step %{I fill in "Fandoms" with "Stargate"} - step %{I fill in "Work Title" with "Followup"} - step %{I fill in "content" with "That could be an amusing crossover."} - step %{I list the work "Worldbuilding" as inspiration} - step %{I press "Preview"} - step %{I press "Edit"} + step %{I go to the new work page} + step %{I select "Not Rated" from "Rating"} + step %{I check "No Archive Warnings Apply"} + step %{I select "English" from "Choose a language"} + step %{I fill in "Fandoms" with "Stargate"} + step %{I fill in "Work Title" with "Followup"} + step %{I fill in "content" with "That could be an amusing crossover."} + step %{I list the work "Worldbuilding" as inspiration} + step %{I press "Preview"} + step %{I press "Edit"} step %{I press "Post"} end