diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-15 21:10:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-15 21:10:04 +0300 |
commit | 5ff1f808adf841bca979cb2fac6bdfa9c449d028 (patch) | |
tree | c95cfbbcb400684b2bc89fee4fc7b614315ba909 /spec/serializers | |
parent | f8a5275c45ed2276daf843764113476749e680d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/runner_entity_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/serializers/runner_entity_spec.rb b/spec/serializers/runner_entity_spec.rb index f34cb794834..b94e1e225ed 100644 --- a/spec/serializers/runner_entity_spec.rb +++ b/spec/serializers/runner_entity_spec.rb @@ -22,5 +22,23 @@ RSpec.describe RunnerEntity do expect(subject).to include(:edit_path) expect(subject).to include(:short_sha) end + + context 'without admin permissions' do + it 'does not contain admin_path field' do + expect(subject).not_to include(:admin_path) + end + end + + context 'with admin permissions' do + let_it_be(:user) { create(:user, :admin) } + + before do + allow(user).to receive(:can_admin_all_resources?).and_return(true) + end + + it 'contains admin_path field' do + expect(subject).to include(:admin_path) + end + end end end |