mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
UX: Don't send emails for discobot notifications.
This commit is contained in:
@ -37,6 +37,9 @@ describe DiscourseNarrativeBot::NewUserNarrative do
|
||||
end
|
||||
|
||||
it 'should create the right message' do
|
||||
NotificationEmailer.enable
|
||||
NotificationEmailer.expects(:process_notification).once
|
||||
|
||||
expect { narrative.notify_timeout(user) }.to change { Post.count }.by(1)
|
||||
|
||||
expect(Post.last.raw).to eq(I18n.t(
|
||||
|
@ -102,6 +102,24 @@ describe DiscourseNarrativeBot::TrackSelector do
|
||||
|
||||
expect(Post.last.raw).to eq(expected_raw.chomp)
|
||||
end
|
||||
|
||||
it 'should not enqueue any user email' do
|
||||
NotificationEmailer.enable
|
||||
user.user_option.update!(email_always: true)
|
||||
|
||||
post.update!(
|
||||
raw: 'show me what you can do',
|
||||
reply_to_post_number: first_post.post_number
|
||||
)
|
||||
|
||||
NotificationEmailer.expects(:process_notification).never
|
||||
|
||||
described_class.new(:reply, user, post_id: post.id).select
|
||||
|
||||
expect(Post.last.raw).to eq(I18n.t(
|
||||
"discourse_narrative_bot.new_user_narrative.formatting.not_found"
|
||||
))
|
||||
end
|
||||
end
|
||||
|
||||
context 'when a non regular post is created' do
|
||||
|
Reference in New Issue
Block a user