Rewind output stream if requesting partial content but get the full media body instead
This commit is contained in:
1 parent
0bb3352496
commit
0155b81771
2 files changed
+23
-2
No files matched your search
@@ -52,7 +52,19 @@ RSpec.describe Google::Apis::Core::DownloadCommand do
|
||||
before(:example) do
|
||||
stub_request(:get, 'https://www.googleapis.com/zoo/animals')
|
||||
.to_return(body: ['Hello ', Timeout::Error])
|
||||
.to_return(body: 'world')
|
||||
.to_return(status: [206, 'Partial content'], body: 'world')
|
||||
end
|
||||
|
||||
it 'should receive entire content' do
|
||||
expect(received).to eql('Hello world')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with disconnects and no partial response' do
|
||||
before(:example) do
|
||||
stub_request(:get, 'https://www.googleapis.com/zoo/animals')
|
||||
.to_return(body: ['Hello ', Timeout::Error])
|
||||
.to_return(body: 'Hello world')
|
||||
end
|
||||
|
||||
it 'should receive entire content' do
|
||||
|
||||
Reference in new issue
Block a user