mirror of
https://github.com/discourse/discourse.git
synced 2026-07-29 15:54:48 -05:00
FEATURE: Send an email notification when a post is approved. (#12665)
We now send an email when a queued post is approved, and we create a notification.
This commit is contained in:
@@ -80,6 +80,19 @@ describe UserNotifications do
|
||||
end
|
||||
end
|
||||
|
||||
describe '.post_approved' do
|
||||
fab!(:post) { Fabricate(:post) }
|
||||
|
||||
it 'works' do
|
||||
subject = UserNotifications.post_approved(user, { notification_data_hash: { post_url: post.url } })
|
||||
|
||||
expect(subject.to).to eq([user.email])
|
||||
expect(subject.subject).to be_present
|
||||
expect(subject.from).to eq([SiteSetting.notification_email])
|
||||
expect(subject.body).to be_present
|
||||
end
|
||||
end
|
||||
|
||||
describe ".confirm_new_email" do
|
||||
let(:opts) do
|
||||
{ requested_by_admin: requested_by_admin, email_token: token }
|
||||
|
||||
Reference in New Issue
Block a user