diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /spec/lib/gitlab/http_spec.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'spec/lib/gitlab/http_spec.rb')
-rw-r--r-- | spec/lib/gitlab/http_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/lib/gitlab/http_spec.rb b/spec/lib/gitlab/http_spec.rb index 93d48379414..9d89167bf81 100644 --- a/spec/lib/gitlab/http_spec.rb +++ b/spec/lib/gitlab/http_spec.rb @@ -35,11 +35,14 @@ RSpec.describe Gitlab::HTTP do super do |response| response.instance_eval do def read_body(*) - @body.each do |fragment| + mock_stream = @body.split(' ') + mock_stream.each do |fragment| sleep 0.002.seconds yield fragment if block_given? end + + @body end end @@ -64,8 +67,8 @@ RSpec.describe Gitlab::HTTP do before do stub_const("#{described_class}::DEFAULT_READ_TOTAL_TIMEOUT", 0.001.seconds) - WebMock.stub_request(:post, /.*/).to_return do |request| - { body: %w(a b), status: 200 } + WebMock.stub_request(:post, /.*/).to_return do + { body: "chunk-1 chunk-2", status: 200 } end end |