DEV: Fix spec (#13225)

DEV: Fix spec (#13225)

Follow-up to 624edac3bbf96a36c20daaf2318d9caece540408

diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 2f5bdfc..6105901 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1993,8 +1993,8 @@ describe User do
     end
 
     it "triggers an event" do
-      event = DiscourseEvent.track_events { user.unstage! }.first
-      expect(event[:event_name]).to eq(:user_unstaged)
+      event = DiscourseEvent.track(:user_unstaged) { user.unstage! }
+      expect(event).to be_present
       expect(event[:params].first).to eq(user)
     end
   end

GitHub sha: fb4dc2f3

This commit appears in #13225 which was approved by jjaffeux. It was merged by gschlager.