summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-03-07 13:58:14 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-03-09 10:23:57 +0200
commit26f28f9654a2f1a49364733e11da2ac9db56645c (patch)
treedc97b15312008f6a9c04252ba5956a493f29f202 /spec/finders
parent72e940df2c24ab80056dfe296011c7a44ebdf3f0 (diff)
downloadgitlab-ce-26f28f9654a2f1a49364733e11da2ac9db56645c.tar.gz
Show members of parent groups on project members pagedz-nested-groups-members
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/members_finder_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/finders/members_finder_spec.rb b/spec/finders/members_finder_spec.rb
new file mode 100644
index 00000000000..cf691cf684b
--- /dev/null
+++ b/spec/finders/members_finder_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe MembersFinder, '#execute' do
+ let(:group) { create(:group) }
+ let(:nested_group) { create(:group, :access_requestable, parent: group) }
+ let(:project) { create(:project, namespace: nested_group) }
+ let(:user1) { create(:user) }
+ let(:user2) { create(:user) }
+ let(:user3) { create(:user) }
+ let(:user4) { create(:user) }
+
+ it 'returns members for project and parent groups' do
+ nested_group.request_access(user1)
+ member1 = group.add_master(user2)
+ member2 = nested_group.add_master(user3)
+ member3 = project.add_master(user4)
+
+ result = described_class.new(project, user2).execute
+
+ expect(result.to_a).to eq([member3, member2, member1])
+ end
+end