Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/discourse_assign/create_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def initialize(assignment:, user:, mark_as_read:)
end

def call
return if topic.nil?
Assigner.publish_topic_tracking_state(topic, user.id)
unless mark_as_read?
PostAlerter.new(post).create_notification_alert(
Expand Down
14 changes: 14 additions & 0 deletions spec/lib/discourse_assign/create_notification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@
create_notification
end

context "when topic is not found" do
before { assignment.topic = nil }

it "does not publish topic tracking state" do
Assigner.expects(:publish_topic_tracking_state).never
create_notification
end

it "does not create a notification alert" do
alerter.expects(:create_notification_alert).never
create_notification
end
end

context "when `mark_as_read` is false" do
let(:excerpt) do
I18n.t(
Expand Down
Loading