Created
April 11, 2025 11:18
-
-
Save javiervidal/bb70bf4ad2afad4946eeda249fa9bf19 to your computer and use it in GitHub Desktop.
Log external requests in tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebMock.allow_net_connect! | |
WebMock.after_request do |request_signature, response| | |
stubbing_instructions = | |
WebMock::RequestSignatureSnippet | |
.new(request_signature) | |
.stubbing_instructions | |
puts '===== outgoing request =======================' | |
puts stubbing_instructions | |
puts | |
puts "response status: #{response.status.inspect}" | |
puts 'body:' | |
puts | |
puts response.body | |
puts '==============================================' | |
puts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment