Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-15 21:10:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-15 21:10:04 +0300
commit5ff1f808adf841bca979cb2fac6bdfa9c449d028 (patch)
treec95cfbbcb400684b2bc89fee4fc7b614315ba909 /spec/serializers
parentf8a5275c45ed2276daf843764113476749e680d2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/runner_entity_spec.rb18
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