summaryrefslogtreecommitdiff
path: root/spec/requests/api/builds_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/builds_spec.rb')
-rw-r--r--spec/requests/api/builds_spec.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/spec/requests/api/builds_spec.rb b/spec/requests/api/builds_spec.rb
index 47e9253a10c..2ab9d640269 100644
--- a/spec/requests/api/builds_spec.rb
+++ b/spec/requests/api/builds_spec.rb
@@ -19,7 +19,7 @@ describe API::API, api: true do
context 'authorized user' do
it 'should return project builds' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
end
@@ -32,7 +32,7 @@ describe API::API, api: true do
let(:query) { 'scope=pending' }
it do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
end
end
@@ -41,7 +41,7 @@ describe API::API, api: true do
let(:query) { 'scope[0]=pending&scope[1]=running' }
it do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
end
end
@@ -49,7 +49,7 @@ describe API::API, api: true do
context 'respond 400 when scope contains invalid state' do
let(:query) { 'scope[0]=pending&scope[1]=unknown_status' }
- it { expect(response.status).to eq(400) }
+ it { expect(response).to have_http_status(400) }
end
end
@@ -57,7 +57,7 @@ describe API::API, api: true do
let(:api_user) { nil }
it 'should not return project builds' do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end
@@ -70,7 +70,7 @@ describe API::API, api: true do
context 'authorized user' do
it 'should return project builds for specific commit' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
end
end
@@ -79,7 +79,7 @@ describe API::API, api: true do
let(:api_user) { nil }
it 'should not return project builds' do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end
@@ -89,7 +89,7 @@ describe API::API, api: true do
context 'authorized user' do
it 'should return specific build data' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response['name']).to eq('test')
end
end
@@ -98,7 +98,7 @@ describe API::API, api: true do
let(:api_user) { nil }
it 'should not return specific build data' do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end
@@ -116,7 +116,7 @@ describe API::API, api: true do
end
it 'should return specific build artifacts' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(response.headers).to include(download_headers)
end
end
@@ -125,13 +125,13 @@ describe API::API, api: true do
let(:api_user) { nil }
it 'should not return specific build artifacts' do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end
it 'should not return build artifacts if not uploaded' do
- expect(response.status).to eq(404)
+ expect(response).to have_http_status(404)
end
end
@@ -142,7 +142,7 @@ describe API::API, api: true do
context 'authorized user' do
it 'should return specific build trace' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(response.body).to eq(build.trace)
end
end
@@ -151,7 +151,7 @@ describe API::API, api: true do
let(:api_user) { nil }
it 'should not return specific build trace' do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end
@@ -162,7 +162,7 @@ describe API::API, api: true do
context 'authorized user' do
context 'user with :update_build persmission' do
it 'should cancel running or pending build' do
- expect(response.status).to eq(201)
+ expect(response).to have_http_status(201)
expect(project.builds.first.status).to eq('canceled')
end
end
@@ -171,7 +171,7 @@ describe API::API, api: true do
let(:api_user) { user2 }
it 'should not cancel build' do
- expect(response.status).to eq(403)
+ expect(response).to have_http_status(403)
end
end
end
@@ -180,7 +180,7 @@ describe API::API, api: true do
let(:api_user) { nil }
it 'should not cancel build' do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end
@@ -193,7 +193,7 @@ describe API::API, api: true do
context 'authorized user' do
context 'user with :update_build permission' do
it 'should retry non-running build' do
- expect(response.status).to eq(201)
+ expect(response).to have_http_status(201)
expect(project.builds.first.status).to eq('canceled')
expect(json_response['status']).to eq('pending')
end
@@ -203,7 +203,7 @@ describe API::API, api: true do
let(:api_user) { user2 }
it 'should not retry build' do
- expect(response.status).to eq(403)
+ expect(response).to have_http_status(403)
end
end
end
@@ -212,7 +212,7 @@ describe API::API, api: true do
let(:api_user) { nil }
it 'should not retry build' do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end