diff options
Diffstat (limited to 'spec/lib/api/entities/project_spec.rb')
-rw-r--r-- | spec/lib/api/entities/project_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/api/entities/project_spec.rb b/spec/lib/api/entities/project_spec.rb index f4073683919..3a5349bb59b 100644 --- a/spec/lib/api/entities/project_spec.rb +++ b/spec/lib/api/entities/project_spec.rb @@ -71,4 +71,26 @@ RSpec.describe ::API::Entities::Project do end end end + + describe '.ci/cd settings' do + context 'when the user is not an admin' do + before do + project.add_reporter(current_user) + end + + it 'does not return ci settings' do + expect(json[:ci_default_git_depth]).to be_nil + end + end + + context 'when the user has admin privileges' do + before do + project.add_maintainer(current_user) + end + + it 'returns ci settings' do + expect(json[:ci_default_git_depth]).to be_present + end + end + end end |