It works. FWIW, both File.read
and File.open
work:
stub_request(:post, image_url)
.to_return(
:status => 200,
:body => File.read('spec/fixtures/image.jpg'),
:headers => {}
)
Just remember to require 'webmock/rspec'
at the top of the test.