2
0

Track delivery failures to FASP (#35628)

This commit is contained in:
David Roetzel
2025-08-04 09:43:34 +02:00
committed by GitHub
parent bf46cffd9e
commit 05cdd3f6eb
4 changed files with 39 additions and 0 deletions

View File

@@ -27,6 +27,14 @@ RSpec.describe Fasp::Request do
'Signature-Input' => /.+/,
})
end
it 'tracks that a successful connection was made' do
provider.delivery_failure_tracker.track_failure!
expect do
subject.send(method, '/test_path')
end.to change(provider.delivery_failure_tracker, :failures).from(1).to(0)
end
end
context 'when the response is not signed' do
@@ -55,6 +63,21 @@ RSpec.describe Fasp::Request do
end
end
end
context 'when the request raises an error' do
before do
stub_request(method, 'https://reqprov.example.com/fasp/test_path')
.to_raise(HTTP::ConnectionError)
end
it "records the failure using the provider's delivery failure tracker" do
expect do
subject.send(method, '/test_path')
end.to raise_error(HTTP::ConnectionError)
expect(provider.delivery_failure_tracker.failures).to eq 1
end
end
end
describe '#get' do