From 9ad813e5d01385fa9551a4579dd7547d92a06249 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 11 Sep 2025 21:33:21 -0500 Subject: [PATCH] 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 --- test/fixtures/events.yml | 8 ++++++++ test/models/notifier/event_notifier_test.rb | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/fixtures/events.yml b/test/fixtures/events.yml index be738ef67..8fb8dde4f 100644 --- a/test/fixtures/events.yml +++ b/test/fixtures/events.yml @@ -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 diff --git a/test/models/notifier/event_notifier_test.rb b/test/models/notifier/event_notifier_test.rb index 6429874e5..e6340b03f 100644 --- a/test/models/notifier/event_notifier_test.rb +++ b/test/models/notifier/event_notifier_test.rb @@ -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