dmails: send email notifications in background job.

This commit is contained in:
evazion
2020-03-14 19:33:28 -05:00
parent 0ef9d6e417
commit dc1742321d
3 changed files with 9 additions and 18 deletions

View File

@@ -126,6 +126,14 @@ class DmailsControllerTest < ActionDispatch::IntegrationTest
assert_redirected_to dmail_path(Dmail.last)
end
end
should "send an email if the recipient has email notifications turned on" do
recipient = create(:user, receive_email_notifications: true, email_address: build(:email_address))
post_auth dmails_path, @user, params: { dmail: { to_name: recipient.name, title: "test", body: "test" }}
assert_redirected_to Dmail.last
assert_enqueued_emails 1
end
end
context "update action" do