More randomly failing specs fixes.

More randomly failing specs fixes.

diff --git a/spec/components/discourse_plugin_spec.rb b/spec/components/discourse_plugin_spec.rb
index 3cd2a9d..1084320 100644
--- a/spec/components/discourse_plugin_spec.rb
+++ b/spec/components/discourse_plugin_spec.rb
@@ -38,11 +38,11 @@ describe DiscoursePlugin do
   context 'registering for callbacks' do
     before do
       plugin.stubs(:hello)
-      plugin.listen_for(:hello)
+      @proc = plugin.listen_for(:hello).first
     end
 
     after do
-      DiscourseEvent.off(:hello)
+      DiscourseEvent.off(:hello, &@proc)
     end
 
     it "calls the method when it is triggered" do

GitHub sha: 35bc0c94

2 Likes

Nice example of “state leak related” heisentest

1 Like