DEV: Use reserved assigned notification type (#302)

This commit is contained in:
Rafael dos Santos Silva 2022-03-16 16:23:14 -03:00 committed by GitHub
parent 6d5987244e
commit 568a13101e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@ module Jobs
user: user, user: user,
post: post, post: post,
username: assigned_by.username, username: assigned_by.username,
notification_type: Notification.types[:custom], notification_type: Notification.types[:assigned] || Notification.types[:custom],
excerpt: excerpt:
I18n.t( I18n.t(
(assigned_to_user ? "discourse_assign.topic_assigned_excerpt" : "discourse_assign.topic_group_assigned_excerpt"), (assigned_to_user ? "discourse_assign.topic_assigned_excerpt" : "discourse_assign.topic_group_assigned_excerpt"),
@ -39,7 +39,7 @@ module Jobs
next if args[:silent] next if args[:silent]
Notification.create!( Notification.create!(
notification_type: Notification.types[:custom], notification_type: Notification.types[:assigned] || Notification.types[:custom],
user_id: user.id, user_id: user.id,
topic_id: topic.id, topic_id: topic.id,
post_number: post.post_number, post_number: post.post_number,

View File

@ -14,7 +14,7 @@ module Jobs
Assigner.publish_topic_tracking_state(topic, user.id) Assigner.publish_topic_tracking_state(topic, user.id)
Notification.where( Notification.where(
notification_type: Notification.types[:custom], notification_type: Notification.types[:assigned] || Notification.types[:custom],
user_id: user.id, user_id: user.id,
topic_id: topic.id, topic_id: topic.id,
).where("data like '%discourse_assign.assign_notification%' OR data like '%discourse_assign.assign_group_notification%'").destroy_all ).where("data like '%discourse_assign.assign_notification%' OR data like '%discourse_assign.assign_group_notification%'").destroy_all

View File

@ -47,7 +47,7 @@ RSpec.describe Jobs::AssignNotification do
it 'sends a high priority notification to the assignee' do it 'sends a high priority notification to the assignee' do
Notification.expects(:create!).with( Notification.expects(:create!).with(
notification_type: Notification.types[:custom], notification_type: Notification.types[:assigned] || Notification.types[:custom],
user_id: user2.id, user_id: user2.id,
topic_id: topic.id, topic_id: topic.id,
post_number: 1, post_number: 1,
@ -96,7 +96,7 @@ RSpec.describe Jobs::AssignNotification do
it 'sends a high priority notification to all group members' do it 'sends a high priority notification to all group members' do
[user2, user3, user4].each do |user| [user2, user3, user4].each do |user|
Notification.expects(:create!).with( Notification.expects(:create!).with(
notification_type: Notification.types[:custom], notification_type: Notification.types[:assigned] || Notification.types[:custom],
user_id: user.id, user_id: user.id,
topic_id: topic.id, topic_id: topic.id,
post_number: 1, post_number: 1,