Fix email handler spec for EE

This commit is contained in:
Michael Kozono 2018-04-09 13:30:43 -07:00
parent 37a5632483
commit e67759bbc9

View file

@ -25,12 +25,12 @@ describe Gitlab::Email::Handler do
described_class.for('email', address).class
end
expect(matched_handlers.uniq).to match_array(Gitlab::Email::Handler::HANDLERS)
expect(matched_handlers.uniq).to match_array(ce_handlers)
end
it 'can pick exactly one handler for each address' do
addresses.each do |address|
matched_handlers = Gitlab::Email::Handler::HANDLERS.select do |handler|
matched_handlers = ce_handlers.select do |handler|
handler.new('email', address).can_handle?
end
@ -38,4 +38,10 @@ describe Gitlab::Email::Handler do
end
end
end
def ce_handlers
@ce_handlers ||= Gitlab::Email::Handler::HANDLERS.reject do |handler|
handler.name.start_with?('Gitlab::Email::Handler::EE::')
end
end
end