Fix misleading test

The access involvement changes exposed that this test wasn't doing what it said it was. For this to be a self-assignment the event creator and assignee need to be the same
This commit is contained in:
Jason Zimdars
2025-09-11 21:33:21 -05:00
parent c4dec29b49
commit 9ad813e5d0
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -13,6 +13,14 @@ logo_assignment_jz:
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify(:jz) ] }.to_json %>
created_at: <%= 1.week.ago + 1.hour %>
logo_assignment_david:
creator: david
collection: writebook
eventable: logo (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify(:david) ] }.to_json %>
created_at: <%= 1.week.ago + 1.hour %>
logo_assignment_km:
creator: david
collection: writebook
+2 -2
View File
@@ -65,9 +65,9 @@ class Notifier::EventNotifierTest < ActiveSupport::TestCase
end
test "assignment events do not notify you if you assigned yourself" do
collections(:writebook).access_for(users(:jz)).access_only!
collections(:writebook).access_for(users(:david)).watching!
notifications = Notifier.for(events(:logo_assignment_jz)).notify
notifications = Notifier.for(events(:logo_assignment_david)).notify
assert_empty notifications
end