diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 15:09:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 15:09:07 +0300 |
commit | 2a040e2655fe0a99df61ad0a7bd0c27e68af0c38 (patch) | |
tree | a245cd0d6dd10f185e2fd098e371adc1ea03b72b /spec/requests/api/events_spec.rb | |
parent | a53d2c37c4934f564caa94543dd4cf5af1703e2d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/events_spec.rb')
-rw-r--r-- | spec/requests/api/events_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/requests/api/events_spec.rb b/spec/requests/api/events_spec.rb index 30e6a1340a8..acf3bb3482a 100644 --- a/spec/requests/api/events_spec.rb +++ b/spec/requests/api/events_spec.rb @@ -16,7 +16,7 @@ describe API::Events do it 'returns authentication error' do get api('/events') - expect(response).to have_gitlab_http_status(401) + expect(response).to have_gitlab_http_status(:unauthorized) end end @@ -24,7 +24,7 @@ describe API::Events do it 'returns users events' do get api('/events?action=closed&target_type=issue&after=2016-12-1&before=2016-12-31', 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 expect(json_response.size).to eq(1) @@ -36,7 +36,7 @@ describe API::Events do get api('/events?action=closed&target_type=issue&after=2016-12-1&before=2016-12-31&scope=all', 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 expect(json_response.size).to eq(2) @@ -50,7 +50,7 @@ describe API::Events do it 'returns users events' do get api('/events?action=closed&target_type=issue&after=2016-12-1&before=2016-12-31', personal_access_token: token) - 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 expect(json_response.size).to eq(1) @@ -63,7 +63,7 @@ describe API::Events do it 'returns a "403" response' do get api('/events', personal_access_token: token_without_scopes) - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end end @@ -76,7 +76,7 @@ describe API::Events do get api("/users/#{user.id}/events", non_member) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response).to be_empty end end @@ -90,7 +90,7 @@ describe API::Events do get api("/users/#{user.id}/events", personal_access_token: non_member_token) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response).to be_empty end end @@ -99,7 +99,7 @@ describe API::Events do it 'accepts a username' do get api("/users/#{user.username}/events", 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 expect(json_response.size).to eq(1) @@ -108,7 +108,7 @@ describe API::Events do it 'returns the events' do get api("/users/#{user.id}/events", 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 expect(json_response.size).to eq(1) @@ -127,7 +127,7 @@ describe API::Events do end it 'responds with HTTP 200 OK' do - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'includes the push payload as a Hash' do @@ -177,7 +177,7 @@ describe API::Events do it 'returns no user events' do get api("/users/#{user.username}/events?scope=all") - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response).to be_an Array expect(json_response.size).to eq(0) end @@ -188,7 +188,7 @@ describe API::Events do it 'returns a 404 error if not found' do get api('/users/42/events', user) - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) expect(json_response['message']).to eq('404 User Not Found') end end |