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:
Diffstat (limited to 'spec/helpers/groups_helper_spec.rb')
-rw-r--r--spec/helpers/groups_helper_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb
index bdcf0ef57ee..1b5f23a5e8e 100644
--- a/spec/helpers/groups_helper_spec.rb
+++ b/spec/helpers/groups_helper_spec.rb
@@ -421,6 +421,20 @@ RSpec.describe GroupsHelper do
end
end
+ describe '#can_admin_service_accounts?', feature_category: :user_management do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:group) { create(:group) }
+
+ before do
+ allow(helper).to receive(:current_user) { user }
+ group.add_owner(user)
+ end
+
+ it 'returns false when current_user can not admin members' do
+ expect(helper.can_admin_service_accounts?(group)).to be(false)
+ end
+ end
+
describe '#localized_jobs_to_be_done_choices' do
it 'has a translation for all `jobs_to_be_done` values' do
expect(localized_jobs_to_be_done_choices.keys).to match_array(NamespaceSetting.jobs_to_be_dones.keys)
@@ -489,6 +503,7 @@ RSpec.describe GroupsHelper do
it 'returns expected hash' do
expect(helper.group_overview_tabs_app_data(group)).to match(
{
+ group_id: group.id,
subgroups_and_projects_endpoint: including("/groups/#{group.path}/-/children.json"),
shared_projects_endpoint: including("/groups/#{group.path}/-/shared_projects.json"),
archived_projects_endpoint: including("/groups/#{group.path}/-/children.json?archived=only"),