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
path: root/spec
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-05-30 12:11:53 +0300
committerToon Claes <toon@gitlab.com>2017-05-30 12:11:53 +0300
commit670a052fd4b9d99a2be0b853c1809e3dcaa8264b (patch)
tree0cc1a7aea8a2f1be4f3676e4504ecc1ddb510a4e /spec
parent86145951ca01a1abab30a257a986f19bfa6a66bf (diff)
GroupsFinder should also returns groups of authorized projects
When a user is authorized to a private project, the group of the project should also be returned by the GroupsFinder.
Diffstat (limited to 'spec')
-rw-r--r--spec/finders/groups_finder_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb
index 6ba86cf1a5f..e50870f63b5 100644
--- a/spec/finders/groups_finder_spec.rb
+++ b/spec/finders/groups_finder_spec.rb
@@ -77,6 +77,15 @@ describe GroupsFinder do
is_expected.to contain_exactly(public_subgroup, internal_subgroup, private_subgroup)
end
end
+
+ context 'authorized to private project' do
+ it 'returns the subgroup of the project' do
+ subproject = create(:empty_project, :private, namespace: private_subgroup)
+ subproject.add_guest(user)
+
+ is_expected.to include(private_subgroup)
+ end
+ end
end
end
end