diff --git a/app/models/notification/event_payload.rb b/app/models/notification/event_payload.rb index b296f7252..9fee43032 100644 --- a/app/models/notification/event_payload.rb +++ b/app/models/notification/event_payload.rb @@ -43,7 +43,7 @@ class Notification::EventPayload < Notification::DefaultPayload when "card_auto_postponed" "Moved to Not Now due to inactivity" else - event.creator.name + "Updated by #{event.creator.name}" end end diff --git a/test/models/notification/push_target/web_test.rb b/test/models/notification/push_target/web_test.rb index 26ad80cc8..4dd95ac40 100644 --- a/test/models/notification/push_target/web_test.rb +++ b/test/models/notification/push_target/web_test.rb @@ -161,6 +161,18 @@ class Notification::PushTarget::WebTest < ActiveSupport::TestCase Notification::PushTarget::Web.new(@notification).process end + test "payload for unhandled action uses updated fallback message" do + event = events(:logo_published) + event.update!(action: "card_unassigned") + @notification.update!(source: event) + + @web_push_pool.expects(:queue).once.with do |payload, _| + payload[:body] == "Updated by #{event.creator.name}" + end + + Notification::PushTarget::Web.new(@notification).process + end + test "payload for mention includes mentioner name" do @web_push_pool.expects(:queue).once.with do |payload, _| payload[:title].include?("mentioned you")