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
merged 2 commits into from Nov 20, 2017

Conversation

Projects
None yet
3 participants
Owner

elzj commented Nov 19, 2017

Issue

https://otwarchive.atlassian.net/browse/AO3-5251

Purpose

Adds a more specific email that goes out when a work is hidden as spam.

Testing

Mark a work as spam and determine that the correct email arrives.

+ @work = Work.find_by(id: creation_id)
+
+ mail(
+ to: @user.email,
@houndci-bot

houndci-bot Nov 19, 2017

Indent the first parameter one step more than the start of the previous line.

Looks good! But is there a way to test that the proper email is sent when a work is marked as spam? I don't imagine it will work in the Cucumber feature because of the sideways we we have to create the spam work, but maybe in RSpec?

- 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

houndci-bot Nov 19, 2017

Parenthesize the param change { ActionMailer::Base.deliveries.count } to make sure that the block will be associated with the change method call.

@sarken sarken merged commit 7570b00 into otwcode:master Nov 20, 2017

3 of 4 checks passed

codeclimate 3 issues to fix
Details
Scrutinizer 1 new issues, 1 updated code elements
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
hound 2 violations found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment