FEATURE: Mark assign notifications as high priority (#67)

This commit is contained in:
Martin Brennan 2020-05-11 14:06:31 +10:00 committed by GitHub
parent c553c039f0
commit b7acd12244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -223,6 +223,7 @@ class ::TopicAssigner
user_id: assign_to.id,
topic_id: @topic.id,
post_number: 1,
high_priority: true,
data: {
message: 'discourse_assign.assign_notification',
display_username: @assigned_by.username,

View File

@ -88,6 +88,22 @@ RSpec.describe TopicAssigner do
.to eq(TopicUser.notification_levels[:muted])
end
it "sends a high priority notification to the assignee" do
Notification.expects(:create!).with(
notification_type: Notification.types[:custom],
user_id: moderator.id,
topic_id: topic.id,
post_number: 1,
high_priority: true,
data: {
message: 'discourse_assign.assign_notification',
display_username: moderator2.username,
topic_title: topic.title
}.to_json
)
assigner.assign(moderator)
end
context "when assigns_by_staff_mention is set to true" do
let(:system_user) { Discourse.system_user }
let(:moderator) { Fabricate(:admin, username: "modi", groups: [assign_allowed_group]) }