spec/airborne/post_spec.rb in airborne-0.3.5 vs spec/airborne/post_spec.rb in airborne-0.3.6

- old
+ new

@@ -12,6 +12,13 @@ url = 'http://www.example.com/simple_post' stub_request(:post, url) post '/simple_post', 'hello', content_type: 'text/plain' expect(WebMock).to have_requested(:post, url).with(body: 'hello', headers: { 'Content-Type' => 'text/plain' }) end + + it 'should allow testing on post requests with IO body' do + url = 'http://www.example.com/simple_post' + stub_request(:post, url) + post '/simple_post', StringIO.new('hello'), content_type: 'application/octet-stream' + expect(WebMock).to have_requested(:post, url).with(body: 'hello', headers: { 'Content-Type' => 'application/octet-stream' }) + end end