DEV: heisentest cause by a post not created yet (#10656)

DEV: heisentest cause by a post not created yet (#10656)

diff --git a/spec/services/user_silencer_spec.rb b/spec/services/user_silencer_spec.rb
index dfe0c33..0e4c621 100644
--- a/spec/services/user_silencer_spec.rb
+++ b/spec/services/user_silencer_spec.rb
@@ -70,8 +70,9 @@ describe UserSilencer do
     end
 
     context 'with a plugin hook' do
-
       before do
+        SystemMessage.unstub(:create)
+
         @override_silence_message = -> (opts) do
           opts[:silence_message_params][:message_title] = "override title"
           opts[:silence_message_params][:message_raw] = "override raw"
@@ -84,8 +85,8 @@ describe UserSilencer do
       end
 
       it 'allows the message to be overridden' do
-        SystemMessage.unstub(:create)
-        UserSilencer.silence(user, Fabricate.build(:admin))
+        UserSilencer.silence(user, Fabricate(:admin))
+
         post = Discourse.system_user.posts.last
         expect(post.topic.title).to eq("override title")
         expect(post.raw).to eq("override raw")

GitHub sha: 539eb639

This commit appears in #10656 which was approved by CvX. It was merged by jjaffeux.