diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2017-10-19 20:28:19 +0200 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2017-10-20 10:13:18 +0200 |
commit | 2f40dac35280f9de9af8c47bdf85c2f0b2d53680 (patch) | |
tree | ece7f87f18b32c8961e784973caf1dd299e877c7 /spec/requests/api/commits_spec.rb | |
parent | b4dc0ba2c57c150f847d255b0d2d831ff60728ad (diff) | |
download | gitlab-ce-2f40dac35280f9de9af8c47bdf85c2f0b2d53680.tar.gz |
Refactor `have_http_status` into `have_gitlab_http_status` in the specs
Diffstat (limited to 'spec/requests/api/commits_spec.rb')
-rw-r--r-- | spec/requests/api/commits_spec.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb index 94462b4572d..0d2bd3207c0 100644 --- a/spec/requests/api/commits_spec.rb +++ b/spec/requests/api/commits_spec.rb @@ -24,7 +24,7 @@ describe API::Commits do get api(route, current_user) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to match_response_schema('public_api/v4/commits') expect(json_response.first['id']).to eq(commit.id) expect(json_response.first['committer_name']).to eq(commit.committer_name) @@ -119,7 +119,7 @@ describe API::Commits do it "returns an invalid parameter error message" do get api("/projects/#{project_id}/repository/commits?since=invalid-date", user) - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) expect(json_response['error']).to eq('since is invalid') end end @@ -198,13 +198,13 @@ describe API::Commits do it 'returns a 403 unauthorized for user without permissions' do post api(url, guest) - expect(response).to have_http_status(403) + expect(response).to have_gitlab_http_status(403) end it 'returns a 400 bad request if no params are given' do post api(url, user) - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) end describe 'create' do @@ -248,7 +248,7 @@ describe API::Commits do it 'returns a 400 bad request if file exists' do post api(url, user), invalid_c_params - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) end context 'with project path containing a dot in URL' do @@ -257,7 +257,7 @@ describe API::Commits do it 'a new file in project repo' do post api(url, user), valid_c_params - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) end end end @@ -292,14 +292,14 @@ describe API::Commits do it 'an existing file in project repo' do post api(url, user), valid_d_params - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response['title']).to eq(message) end it 'returns a 400 bad request if file does not exist' do post api(url, user), invalid_d_params - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) end end @@ -337,14 +337,14 @@ describe API::Commits do it 'an existing file in project repo' do post api(url, user), valid_m_params - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response['title']).to eq(message) end it 'returns a 400 bad request if file does not exist' do post api(url, user), invalid_m_params - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) end end @@ -380,14 +380,14 @@ describe API::Commits do it 'an existing file in project repo' do post api(url, user), valid_u_params - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response['title']).to eq(message) end it 'returns a 400 bad request if file does not exist' do post api(url, user), invalid_u_params - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) end end @@ -453,14 +453,14 @@ describe API::Commits do it 'are commited as one in project repo' do post api(url, user), valid_mo_params - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response['title']).to eq(message) end it 'return a 400 bad request if there are any issues' do post api(url, user), invalid_mo_params - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) end end end @@ -571,7 +571,7 @@ describe API::Commits do it 'includes a "created" status' do get api(route, current_user) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to match_response_schema('public_api/v4/commit/detail') expect(json_response['status']).to eq('created') expect(json_response['last_pipeline']['id']).to eq(pipeline.id) @@ -588,7 +588,7 @@ describe API::Commits do it 'includes a "success" status' do get api(route, current_user) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to match_response_schema('public_api/v4/commit/detail') expect(json_response['status']).to eq('success') end |