diff options
Diffstat (limited to 'spec/requests/ci/api')
-rw-r--r-- | spec/requests/ci/api/builds_spec.rb | 25 | ||||
-rw-r--r-- | spec/requests/ci/api/runners_spec.rb | 10 |
2 files changed, 22 insertions, 13 deletions
diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb index 7b7d62feb2c..6d49c42c215 100644 --- a/spec/requests/ci/api/builds_spec.rb +++ b/spec/requests/ci/api/builds_spec.rb @@ -220,26 +220,33 @@ describe Ci::API::API do end context 'when request is valid' do - it { expect(response.status).to eq 202 } + it 'gets correct response' do + expect(response.status).to eq 202 + expect(response.header).to have_key 'Range' + expect(response.header).to have_key 'Build-Status' + end + it { expect(build.reload.trace).to eq 'BUILD TRACE appended' } - it { expect(response.header).to have_key 'Range' } - it { expect(response.header).to have_key 'Build-Status' } end context 'when content-range start is too big' do let(:headers_with_range) { headers.merge({ 'Content-Range' => '15-20' }) } - it { expect(response.status).to eq 416 } - it { expect(response.header).to have_key 'Range' } - it { expect(response.header['Range']).to eq '0-11' } + it 'gets correct response' do + expect(response.status).to eq 416 + expect(response.header).to have_key 'Range' + expect(response.header['Range']).to eq '0-11' + end end context 'when content-range start is too small' do let(:headers_with_range) { headers.merge({ 'Content-Range' => '8-20' }) } - it { expect(response.status).to eq 416 } - it { expect(response.header).to have_key 'Range' } - it { expect(response.header['Range']).to eq '0-11' } + it 'gets correct response' do + expect(response.status).to eq 416 + expect(response.header).to have_key 'Range' + expect(response.header['Range']).to eq '0-11' + end end context 'when Content-Range header is missing' do diff --git a/spec/requests/ci/api/runners_spec.rb b/spec/requests/ci/api/runners_spec.rb index 43596f07cb5..d6c26fd8a94 100644 --- a/spec/requests/ci/api/runners_spec.rb +++ b/spec/requests/ci/api/runners_spec.rb @@ -109,10 +109,12 @@ describe Ci::API::API do end describe "DELETE /runners/delete" do - let!(:runner) { FactoryGirl.create(:ci_runner) } - before { delete ci_api("/runners/delete"), token: runner.token } + it 'returns 200' do + runner = FactoryGirl.create(:ci_runner) + delete ci_api("/runners/delete"), token: runner.token - it { expect(response).to have_http_status 200 } - it { expect(Ci::Runner.count).to eq(0) } + expect(response).to have_http_status 200 + expect(Ci::Runner.count).to eq(0) + end end end |