mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: when the user is promoted to TL2 invite to advance training (#10752)
Invitation to advanced training should be sent as a separate private message instead of hooking into TL2 promotion message.
This commit is contained in:

committed by
GitHub

parent
e7c72cd1e4
commit
902fbd0b7e
@ -732,4 +732,13 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'invites to advanced training when user is promoted to TL2' do
|
||||
recipient = Fabricate(:user)
|
||||
expect {
|
||||
DiscourseEvent.trigger(:system_message_sent, post: Post.last, message_type: 'tl2_promotion_message')
|
||||
}.to change { Topic.count }
|
||||
expect(Topic.last.title).to eq(I18n.t("discourse_narrative_bot.tl2_promotion_message.subject_template"))
|
||||
expect(Topic.last.topic_users.map(&:user_id).sort).to eq([DiscourseNarrativeBot::Base.new.discobot_user.id, recipient.id])
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user