Merge pull request #2453 from wairbut-m2c/backport-1194-emails-users-wo-email-should-not-receive-emails

Backport PR #1206 from Madrid's fork
This commit is contained in:
BertoCQ
2018-02-08 15:37:34 +01:00
committed by GitHub

View File

@@ -492,11 +492,15 @@ feature 'Emails' do
end
context "Users without email" do
scenario "should not receive emails", :js do
scenario "should not receive emails" do
user = create(:user, :verified, email_on_comment: true)
proposal = create(:proposal, author: user)
user_commenting = create(:user)
comment = create(:comment, commentable: proposal, user: user_commenting)
user.update(email: nil)
comment_on(proposal)
Mailer.comment(comment).deliver_now
expect { open_last_email }.to raise_error "No email has been sent!"
end