diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-08-02 01:31:21 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-09-01 17:47:59 +0300 |
commit | 892dea67717c0efbd6a28f7639f34535ec0a8747 (patch) | |
tree | 83191c811b58de808da77f51aed63a1a021b2dcb /spec/requests/jwt_controller_spec.rb | |
parent | e71cd7a300017cf85e16de3b1c68fdb25c3a4b4d (diff) |
Project tools visibility level
Diffstat (limited to 'spec/requests/jwt_controller_spec.rb')
-rw-r--r-- | spec/requests/jwt_controller_spec.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/requests/jwt_controller_spec.rb b/spec/requests/jwt_controller_spec.rb index c6172b9cc7d..fc42b534dca 100644 --- a/spec/requests/jwt_controller_spec.rb +++ b/spec/requests/jwt_controller_spec.rb @@ -22,19 +22,20 @@ describe JwtController do context 'when using authorized request' do context 'using CI token' do - let(:project) { create(:empty_project, runners_token: 'token', builds_enabled: builds_enabled) } + let(:project) { create(:empty_project, runners_token: 'token') } let(:headers) { { authorization: credentials('gitlab-ci-token', project.runners_token) } } - subject! { get '/jwt/auth', parameters, headers } - context 'project with enabled CI' do - let(:builds_enabled) { true } - + subject! { get '/jwt/auth', parameters, headers } it { expect(service_class).to have_received(:new).with(project, nil, parameters) } end context 'project with disabled CI' do - let(:builds_enabled) { false } + before do + project.project_feature.update_attribute(:builds_access_level, ProjectFeature::DISABLED) + end + + subject! { get '/jwt/auth', parameters, headers } it { expect(response).to have_http_status(403) } end |