Commit 4ffc9ce7 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix stubbing of SMIME certificate

We stub the outer method instead so that the value is not memoized for
succeeding specs
parent eea9ad53
...@@ -36,7 +36,7 @@ RSpec.describe Gitlab::Email::Hook::SmimeSignatureInterceptor do ...@@ -36,7 +36,7 @@ RSpec.describe Gitlab::Email::Hook::SmimeSignatureInterceptor do
end end
before do before do
allow(Gitlab::X509::Certificate).to receive_messages(from_files: certificate) allow(Gitlab::Email::Hook::SmimeSignatureInterceptor).to receive(:certificate).and_return(certificate)
Mail.register_interceptor(described_class) Mail.register_interceptor(described_class)
mail.deliver_now mail.deliver_now
......
...@@ -157,7 +157,7 @@ RSpec.describe EmailsOnPushWorker, :mailer do ...@@ -157,7 +157,7 @@ RSpec.describe EmailsOnPushWorker, :mailer do
end end
before do before do
allow(Gitlab::X509::Certificate).to receive_messages(from_files: certificate) allow(Gitlab::Email::Hook::SmimeSignatureInterceptor).to receive(:certificate).and_return(certificate)
Mail.register_interceptor(Gitlab::Email::Hook::SmimeSignatureInterceptor) Mail.register_interceptor(Gitlab::Email::Hook::SmimeSignatureInterceptor)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment