How to simulate Request Timeout in rspec with faraday

3.7k views Asked by At

I use Faraday gem in app, and I want to test how my app works when Faraday connection fails by timeout. How can I stub request for this case?

1

There are 1 answers

0
pustserg On

I found a working method. May be it is not beautiful, but is works.

faraday_adapter.post('fail') do
  raise Faraday::TimeoutError
end