diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-02 18:07:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-02 18:07:42 +0000 |
commit | 7b52c7cb634ef7047d30b0337fe477bcdcedf41d (patch) | |
tree | 374ca9e908204488422046f10e340d1500780362 /spec/requests/api/repositories_spec.rb | |
parent | b375c6c05fbd03aea33a9ee9f82e678bdaa8c3cc (diff) | |
download | gitlab-ce-7b52c7cb634ef7047d30b0337fe477bcdcedf41d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/repositories_spec.rb')
-rw-r--r-- | spec/requests/api/repositories_spec.rb | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb index b1a65ded9ef..97dc3899d3f 100644 --- a/spec/requests/api/repositories_spec.rb +++ b/spec/requests/api/repositories_spec.rb @@ -19,7 +19,7 @@ describe API::Repositories do it 'returns the repository tree' do get api(route, current_user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(json_response).to be_an Array @@ -108,7 +108,7 @@ describe API::Repositories do it 'returns blob attributes as json' do get api(route, current_user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['size']).to eq(111) expect(json_response['encoding']).to eq("base64") expect(Base64.decode64(json_response['content']).lines.first).to eq("class Commit\n") @@ -167,7 +167,7 @@ describe API::Repositories do get api(route, current_user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(headers[Gitlab::Workhorse::DETECT_HEADER]).to eq "true" end @@ -231,7 +231,7 @@ describe API::Repositories do it 'returns the repository archive' do get api(route, current_user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) type, params = workhorse_send_data @@ -242,7 +242,7 @@ describe API::Repositories do it 'returns the repository archive archive.zip' do get api("/projects/#{project.id}/repository/archive.zip", user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) type, params = workhorse_send_data @@ -253,7 +253,7 @@ describe API::Repositories do it 'returns the repository archive archive.tar.bz2' do get api("/projects/#{project.id}/repository/archive.tar.bz2", user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) type, params = workhorse_send_data @@ -314,7 +314,7 @@ describe API::Repositories do }).and_call_original get api(route, current_user), params: { from: 'master', to: 'feature' } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['commits']).to be_present expect(json_response['diffs']).to be_present end @@ -325,7 +325,7 @@ describe API::Repositories do }).and_call_original get api(route, current_user), params: { from: 'master', to: 'feature', straight: false } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['commits']).to be_present expect(json_response['diffs']).to be_present end @@ -336,7 +336,7 @@ describe API::Repositories do }).and_call_original get api(route, current_user), params: { from: 'master', to: 'feature', straight: true } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['commits']).to be_present expect(json_response['diffs']).to be_present end @@ -344,7 +344,7 @@ describe API::Repositories do it "compares tags" do get api(route, current_user), params: { from: 'v1.0.0', to: 'v1.1.0' } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['commits']).to be_present expect(json_response['diffs']).to be_present end @@ -352,7 +352,7 @@ describe API::Repositories do it "compares commits" do get api(route, current_user), params: { from: sample_commit.id, to: sample_commit.parent_id } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['commits']).to be_empty expect(json_response['diffs']).to be_empty expect(json_response['compare_same_ref']).to be_falsey @@ -361,7 +361,7 @@ describe API::Repositories do it "compares commits in reverse order" do get api(route, current_user), params: { from: sample_commit.parent_id, to: sample_commit.id } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['commits']).to be_present expect(json_response['diffs']).to be_present end @@ -369,7 +369,7 @@ describe API::Repositories do it "compares same refs" do get api(route, current_user), params: { from: 'master', to: 'master' } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['commits']).to be_empty expect(json_response['diffs']).to be_empty expect(json_response['compare_same_ref']).to be_truthy @@ -380,7 +380,7 @@ describe API::Repositories do get api(route, current_user), params: { from: 'master', to: 'feature' } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['commits']).to be_present expect(json_response['diffs']).to be_present expect(json_response['diffs'].first['diff']).to be_empty @@ -389,13 +389,13 @@ describe API::Repositories do it "returns a 404 when from ref is unknown" do get api(route, current_user), params: { from: 'unknown_ref', to: 'master' } - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end it "returns a 404 when to ref is unknown" do get api(route, current_user), params: { from: 'master', to: 'unknown_ref' } - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -433,7 +433,7 @@ describe API::Repositories do it 'returns valid data' do get api(route, current_user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(json_response).to be_an Array @@ -450,7 +450,7 @@ describe API::Repositories do it 'returns the repository contribuors sorted by commits desc' do get api(route, current_user), params: { order_by: 'commits', sort: 'desc' } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('contributors') expect(json_response.first['commits']).to be > json_response.last['commits'] end @@ -460,7 +460,7 @@ describe API::Repositories do it 'returns the repository contribuors sorted by name asc case insensitive' do get api(route, current_user), params: { order_by: 'name', sort: 'asc' } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('contributors') expect(json_response.first['name'].downcase).to be < json_response.last['name'].downcase end |