mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
DEV: Add spec for notification data modifier (#22223)
This commit is contained in:
parent
0de3b279ce
commit
114a9a10b7
@ -1150,6 +1150,20 @@ RSpec.describe PostAlerter do
|
|||||||
params: [user, type, post, { revision_number: 1 }],
|
params: [user, type, post, { revision_number: 1 }],
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "applies modifiers to notification_data" do
|
||||||
|
Plugin::Instance
|
||||||
|
.new
|
||||||
|
.register_modifier(:notification_data) do |notification_data|
|
||||||
|
notification_data[:silly_key] = "silly value"
|
||||||
|
notification_data
|
||||||
|
end
|
||||||
|
|
||||||
|
notification = PostAlerter.new.create_notification(user, type, post)
|
||||||
|
expect(notification.data_hash[:silly_key]).to eq("silly value")
|
||||||
|
|
||||||
|
DiscoursePluginRegistry.clear_modifiers!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".push_notification" do
|
describe ".push_notification" do
|
||||||
|
Loading…
Reference in New Issue
Block a user