diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-05-06 20:54:41 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-05-07 09:53:32 +0300 |
commit | 8d8534d7ab31ef9f7bdc4e00c54bcda9d9bf93d9 (patch) | |
tree | 056de43f43ad53bb447820b86ed92475441d5ec2 /spec/requests/api/runner_spec.rb | |
parent | 1f39fcd1123c1a65798a0a0b3e5f3b2fa43651ac (diff) |
Enforce proper 416 support for runner trace patch endpoint
Diffstat (limited to 'spec/requests/api/runner_spec.rb')
-rw-r--r-- | spec/requests/api/runner_spec.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index f02c001f85d..082605827b7 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -906,20 +906,18 @@ describe API::Runner, :clean_gitlab_redis_shared_state do context 'when we perform partial patch' do before do - patch_the_trace('hello', headers.merge({ 'Content-Range' => "28-32" })) + patch_the_trace('hello', headers.merge({ 'Content-Range' => "28-32/5" })) end it 'returns an error' do - expect(response.status).to eq(202) - expect(response.header).to have_key 'Range' - expect(response.header['Range']).to eq '0-0' - expect(job.reload.trace.raw).to eq '' + expect(response.status).to eq(416) + expect(response.header['Range']).to eq('0-0') end end context 'when we resend full trace' do before do - patch_the_trace('BUILD TRACE appended appended hello', headers.merge({ 'Content-Range' => "0-32" })) + patch_the_trace('BUILD TRACE appended appended hello', headers.merge({ 'Content-Range' => "0-34/35" })) end it 'succeeds with updating trace' do @@ -945,7 +943,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do end context 'when content-range start is too big' do - let(:headers_with_range) { headers.merge({ 'Content-Range' => '15-20' }) } + let(:headers_with_range) { headers.merge({ 'Content-Range' => '15-20/6' }) } it 'gets 416 error response with range headers' do expect(response.status).to eq 416 @@ -955,7 +953,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do end context 'when content-range start is too small' do - let(:headers_with_range) { headers.merge({ 'Content-Range' => '8-20' }) } + let(:headers_with_range) { headers.merge({ 'Content-Range' => '8-20/13' }) } it 'gets 416 error response with range headers' do expect(response.status).to eq 416 |