mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Old notifications didn't link to correct post after moving post
This commit is contained in:
@@ -5,6 +5,7 @@ Fabricator(:notification) do
|
||||
notification_type Notification.types[:mentioned]
|
||||
user
|
||||
topic { |attrs| attrs[:post]&.topic || Fabricate(:topic, user: attrs[:user]) }
|
||||
post_number { |attrs| attrs[:post]&.post_number }
|
||||
data '{"poison":"ivy","killer":"croc"}'
|
||||
end
|
||||
|
||||
@@ -57,3 +58,17 @@ Fabricator(:posted_notification, from: :notification) do
|
||||
}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
Fabricator(:mentioned_notification, from: :notification) do
|
||||
notification_type Notification.types[:mentioned]
|
||||
data do |attrs|
|
||||
{
|
||||
topic_title: attrs[:topic].title,
|
||||
original_post_id: attrs[:post].id,
|
||||
original_post_type: attrs[:post].post_type,
|
||||
original_username: attrs[:post].user.username,
|
||||
revision_number: nil,
|
||||
display_username: attrs[:post].user.username
|
||||
}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user