diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-27 00:08:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-27 00:08:38 +0300 |
commit | 936d15143b786f841bf0ee8e2458215ee010f33e (patch) | |
tree | f850c872c4d0328358ebdec10a343e8c63e519ce /spec/helpers | |
parent | f57f1c6cd8a89454bb8a4a1b965738dcc8007d5d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/groups_helper_spec.rb | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb index ad6852f63df..13f84fecaa5 100644 --- a/spec/helpers/groups_helper_spec.rb +++ b/spec/helpers/groups_helper_spec.rb @@ -313,15 +313,30 @@ RSpec.describe GroupsHelper do it 'returns all the expected links' do links = [ :overview, :activity, :issues, :labels, :milestones, :merge_requests, - :group_members, :settings + :runners, :group_members, :settings ] expect(helper.group_sidebar_links).to include(*links) end - it 'includes settings when the user can admin the group' do + it 'excludes runners when the user cannot admin the group' do expect(helper).to receive(:current_user) { user } - expect(helper).to receive(:can?).with(user, :admin_group, group) { false } + # TODO Proper policies, such as `read_group_runners, should be implemented per + # See https://gitlab.com/gitlab-org/gitlab/-/issues/334802 + expect(helper).to receive(:can?).twice.with(user, :admin_group, group) { false } + + expect(helper.group_sidebar_links).not_to include(:runners) + end + + it 'excludes runners when the feature "runner_list_group_view_vue_ui" is disabled' do + stub_feature_flags(runner_list_group_view_vue_ui: false) + + expect(helper.group_sidebar_links).not_to include(:runners) + end + + it 'excludes settings when the user can admin the group' do + expect(helper).to receive(:current_user) { user } + expect(helper).to receive(:can?).twice.with(user, :admin_group, group) { false } expect(helper.group_sidebar_links).not_to include(:settings) end |