Recording real requests with WebMock | Arkency Blog
11-Mar-2021 1561
Caveat: it’s global, i.e. it’ll apply to all the test cases you’ll run. If you want it for just one test case, run just a single one.(As far as I tried, there’s no easy way to cleanly make it per-example with an around hook, because that would mean we need to store and restore the list of WebMock callbacks. You can get them from WebMock::CallbackRegistry.callbacks, but I couldn’t find a way to set them back, apart from WebMock::CallbackRegistry.reset which empties the list of callback, which is fine only when there were no other callbacks in the first place.).
Recording real requests with WebMock | Arkency Blog #ruby #rubydeveloper #rubyonrails #Recording #requests #WebMock #Arkency #blog #recording #webmock https://rubyonrails.ba/link/recording-real-requests-with-webmock-arkency-blog