Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
AO3-5251: Add spam-specific hidden work email #3171
Merged
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
Jump to file or symbol
Failed to load files and symbols.
| @@ -0,0 +1,12 @@ | ||
| +<% content_for :message do %> | ||
| + <p>Dear <%= @user.default_pseud.byline %>,</p> | ||
| + | ||
| + <p>Your work <i><%= style_link(@work.title.html_safe, work_url(@work)) %></i> has been flagged by our automated system as spam and hidden until it can be reviewed by our Abuse team. While the work is hidden it can only be accessed by you and AO3 site admins.</p> | ||
| + | ||
| + <p>If we determine that your work is not spam, we'll unhide it. Other users will then be able to access and leave feedback on it as usual. Please note that we do not screen works for other kinds of violations at this time. If your work is reported to us for a different reason in the future, that will be investigated separately.</p> | ||
| + | ||
| + <p>If you have any questions, please <%= abuse_link("contact our Abuse Team") %>.</p> | ||
| + | ||
| + <p>Sincerely,</p> | ||
| + <p><%= style_bold("AO3 Abuse") %></p> | ||
| +<% end %> |
| @@ -0,0 +1,12 @@ | ||
| +<% content_for :message do %> | ||
| + Dear <%= @user.default_pseud.byline %>, | ||
| + | ||
| + Your work "<%= @work.title.html_safe %>" (<%= work_url(@work) %>) has been flagged by our automated system as spam and hidden until it can be reviewed by our Abuse team. While the work is hidden it can only be accessed by you and AO3 site admins. | ||
| + | ||
| + If we determine that your work is not spam, we'll unhide it. Other users will then be able to access and leave feedback on it as usual. Please note that we do not screen works for other kinds of violations at this time. If your work is reported to us for a different reason in the future, that will be investigated separately. | ||
| + | ||
| + If you have any questions, please contact our Abuse Team (<%= new_abuse_report_url %>). | ||
| + | ||
| + Sincerely, | ||
| + AO3 Abuse | ||
| +<% end %> |
| @@ -229,17 +229,20 @@ | ||
| before do | ||
| @admin_setting.update_attribute(:hide_spam, true) | ||
| end | ||
| - it "automatically hides spam works" do | ||
| - @work.update_attributes!(spam: true) | ||
| + it "automatically hides spam works and sends an email" do | ||
| + expect { @work.update_attributes!(spam: true) }. | ||
| + to change { ActionMailer::Base.deliveries.count }.by(1) | ||
| expect(@work.reload.hidden_by_admin).to be_truthy | ||
| + expect(ActionMailer::Base.deliveries.last.subject).to eq("[AO3] Your work was hidden as spam") | ||
| end | ||
| end | ||
| context "when the admin setting is disabled" do | ||
| before do | ||
| @admin_setting.update_attribute(:hide_spam, false) | ||
| end | ||
| - it "does not automatically hide spam works" do | ||
| - @work.update_attributes!(spam: true) | ||
| + it "does not automatically hide spam works and does not send an email" do | ||
| + expect { @work.update_attributes!(spam: true) }. | ||
houndci-bot
|
||
| + not_to change { ActionMailer::Base.deliveries.count } | ||
| expect(@work.reload.hidden_by_admin).to be_falsey | ||
| end | ||
| end | ||
Indent the first parameter one step more than the start of the previous line.