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

This commit is contained in:
Joffrey JAFFEUX 2020-09-12 08:47:06 +02:00 committed by GitHub
parent 24f19e8372
commit 539eb63904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -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")