diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-12-14 18:36:33 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-12-19 16:50:35 +0300 |
commit | c7ea28612a210811696dae50d6ca948c85566da2 (patch) | |
tree | 6b5f8bcf31df78bb63d482c9eb1f6fc234b7d5a4 /spec/requests | |
parent | f9fd9b1def8dec9800f8d3857ee278ed6dca03c3 (diff) |
Authorize read_build action when listing jobs
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/jobs_spec.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/requests/api/jobs_spec.rb b/spec/requests/api/jobs_spec.rb index 73131dba542..6deb842b0bc 100644 --- a/spec/requests/api/jobs_spec.rb +++ b/spec/requests/api/jobs_spec.rb @@ -142,10 +142,20 @@ describe API::Jobs do end context 'unauthorized user' do - let(:api_user) { nil } + context 'when user is not logged in' do + let(:api_user) { nil } - it 'does not return project jobs' do - expect(response).to have_gitlab_http_status(401) + it 'does not return project jobs' do + expect(response).to have_gitlab_http_status(401) + end + end + + context 'when user is guest' do + let(:api_user) { guest } + + it 'does not return project jobs' do + expect(response).to have_gitlab_http_status(403) + end end end |