Closed aharbick closed 4 years ago
NVM... I figured it out.
Billy.proxy.stub(/some_image_path/).and_return(
headers: {
'Content-type' => 'image/png',
'Access-Control-Allow-Origin' => '*'
},
body: IO.read("/path/to/stub-image.png"),
code: 200
)
I've been hunting for some examples... I have an app that uses S3 to store images. It would be nice to mock requests and return actual images that could be asserted in capybara, and visual tests in percy would be consistent.
Thoughts?