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>2020-06-18 14:18:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/finders/groups_finder_spec.rb
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/finders/groups_finder_spec.rb')
-rw-r--r--spec/finders/groups_finder_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb
index 939b818f165..78764f79a6c 100644
--- a/spec/finders/groups_finder_spec.rb
+++ b/spec/finders/groups_finder_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe GroupsFinder do
+RSpec.describe GroupsFinder do
describe '#execute' do
let(:user) { create(:user) }
@@ -74,6 +74,12 @@ describe GroupsFinder do
let!(:internal_subgroup) { create(:group, :internal, parent: parent_group) }
let!(:private_subgroup) { create(:group, :private, parent: parent_group) }
+ context 'with [nil] parent' do
+ it 'returns only top-level groups' do
+ expect(described_class.new(user, parent: [nil]).execute).to contain_exactly(parent_group)
+ end
+ end
+
context 'without a user' do
it 'only returns parent and public subgroups' do
expect(described_class.new(nil).execute).to contain_exactly(parent_group, public_subgroup)