Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-27 21:10:42 +0300
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-06-27 21:10:42 +0300
commitabca19da8b0ec12548140f8e771cfc08968d6972 (patch)
tree1db15dba43c2f51a423b8f71a1dbb87e5ea332e2 /spec/requests/api/commit_statuses_spec.rb
parente0e325625eb141445720999d4e4a4d60a4b59d95 (diff)
Use HTTP matchers if possible
Diffstat (limited to 'spec/requests/api/commit_statuses_spec.rb')
-rw-r--r--spec/requests/api/commit_statuses_spec.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/requests/api/commit_statuses_spec.rb b/spec/requests/api/commit_statuses_spec.rb
index 298cdbad329..6668f3543f6 100644
--- a/spec/requests/api/commit_statuses_spec.rb
+++ b/spec/requests/api/commit_statuses_spec.rb
@@ -41,7 +41,7 @@ describe API::CommitStatuses, api: true do
before { get api(get_url, reporter) }
it 'returns latest commit statuses' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
expect(statuses_id).to contain_exactly(status3.id, status4.id, status5.id, status6.id)
@@ -54,7 +54,7 @@ describe API::CommitStatuses, api: true do
before { get api(get_url, reporter), all: 1 }
it 'returns all commit statuses' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
expect(statuses_id).to contain_exactly(status1.id, status2.id,
@@ -67,7 +67,7 @@ describe API::CommitStatuses, api: true do
before { get api(get_url, reporter), ref: 'develop' }
it 'returns latest commit statuses for specific ref' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
expect(statuses_id).to contain_exactly(status3.id, status5.id)
@@ -78,7 +78,7 @@ describe API::CommitStatuses, api: true do
before { get api(get_url, reporter), name: 'coverage' }
it 'return latest commit statuses for specific name' do
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
expect(statuses_id).to contain_exactly(status4.id, status5.id)
@@ -101,7 +101,7 @@ describe API::CommitStatuses, api: true do
before { get api(get_url, guest) }
it "should not return project commits" do
- expect(response.status).to eq(403)
+ expect(response).to have_http_status(403)
end
end
@@ -109,7 +109,7 @@ describe API::CommitStatuses, api: true do
before { get api(get_url) }
it "should not return project commits" do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end
@@ -122,7 +122,7 @@ describe API::CommitStatuses, api: true do
before { post api(post_url, developer), state: 'success' }
it 'creates commit status' do
- expect(response.status).to eq(201)
+ expect(response).to have_http_status(201)
expect(json_response['sha']).to eq(commit.id)
expect(json_response['status']).to eq('success')
expect(json_response['name']).to eq('default')
@@ -141,7 +141,7 @@ describe API::CommitStatuses, api: true do
end
it 'creates commit status' do
- expect(response.status).to eq(201)
+ expect(response).to have_http_status(201)
expect(json_response['sha']).to eq(commit.id)
expect(json_response['status']).to eq('success')
expect(json_response['name']).to eq('coverage')
@@ -155,7 +155,7 @@ describe API::CommitStatuses, api: true do
before { post api(post_url, developer), state: 'invalid' }
it 'does not create commit status' do
- expect(response.status).to eq(400)
+ expect(response).to have_http_status(400)
end
end
@@ -163,7 +163,7 @@ describe API::CommitStatuses, api: true do
before { post api(post_url, developer) }
it 'does not create commit status' do
- expect(response.status).to eq(400)
+ expect(response).to have_http_status(400)
end
end
@@ -172,7 +172,7 @@ describe API::CommitStatuses, api: true do
before { post api(post_url, developer), state: 'running' }
it 'returns not found error' do
- expect(response.status).to eq(404)
+ expect(response).to have_http_status(404)
end
end
end
@@ -181,7 +181,7 @@ describe API::CommitStatuses, api: true do
before { post api(post_url, reporter) }
it 'should not create commit status' do
- expect(response.status).to eq(403)
+ expect(response).to have_http_status(403)
end
end
@@ -189,7 +189,7 @@ describe API::CommitStatuses, api: true do
before { post api(post_url, guest) }
it 'should not create commit status' do
- expect(response.status).to eq(403)
+ expect(response).to have_http_status(403)
end
end
@@ -197,7 +197,7 @@ describe API::CommitStatuses, api: true do
before { post api(post_url) }
it 'should not create commit status' do
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
end