Commit 161301c5 authored by Stan Hu's avatar Stan Hu

Fix order-dependent spec failure in imap_authentication_check_spec.rb

When `spec/lib/gitlab/mail_room/mail_room_spec.rb` is run before
`spec/lib/system_check/incoming_email/imap_authentication_check_spec.rb`,
`Gitlab::MailRoom.enabled_configs` leaks state from one test to another.

To fix this, we should clean up the instance variable after the tests finish.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/332706
parent 1ae52243
......@@ -33,6 +33,10 @@ RSpec.describe Gitlab::MailRoom do
described_class.instance_variable_set(:@enabled_configs, nil)
end
after do
described_class.instance_variable_set(:@enabled_configs, nil)
end
describe '#enabled_configs' do
before do
allow(described_class).to receive(:load_yaml).and_return(configs)
......
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