FIX: Swallow SSL errors when generating oneboxes

This commit is contained in:
Loïc Guitaut
2022-08-09 12:13:56 +02:00
committed by Loïc Guitaut
parent 14cc67c9b2
commit afe7785141
2 changed files with 26 additions and 5 deletions

View File

@ -470,6 +470,23 @@ RSpec.describe FinalDestination do
expect(get).to be_blank
end
end
context "when there is an SSL error" do
subject(:get) { fd.get {} }
before do
fd.stubs(:safe_session).raises(OpenSSL::SSL::SSLError)
end
it "logs the exception" do
Rails.logger.expects(:warn).with(regexp_matches(/an error with ssl occurred/i))
get
end
it "returns nothing" do
expect(get).to be_blank
end
end
end
describe '.validate_uri' do