The flaky test has been modified completely to test the functionality described. JS has been avoided because it was one of the problems involved and it wasn't completely necessary.

This commit is contained in:
iagirre
2018-02-08 08:21:59 +01:00
parent 9579a751ab
commit 80f97b3ca6

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