summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-12-29 00:00:10 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-12-29 00:00:10 +0000
commitc595b41881896e0987d66d9be8b307cfed97fd7d (patch)
treee74461388cf51806f050316a5045f5270b55104c /spec/models
parent7d0e63faffcbb818e686cb3d2dd1aefdbb957d4a (diff)
parent9f39953eaf5568eb75bd2ecf1bab230bbf13f330 (diff)
downloadgitlab-ce-c595b41881896e0987d66d9be8b307cfed97fd7d.tar.gz
Merge branch 'dz-nested-group-access' into 'master'
Inherit permissions from parent group See merge request !8071
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/group_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 7d5ecfbaa64..45fe927202b 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -277,4 +277,15 @@ describe Group, models: true do
it { is_expected.to be_valid }
it { expect(subject.parent).to be_kind_of(Group) }
end
+
+ describe '#members_with_parents' do
+ let!(:group) { create(:group, :nested) }
+ let!(:master) { group.parent.add_user(create(:user), GroupMember::MASTER) }
+ let!(:developer) { group.add_user(create(:user), GroupMember::DEVELOPER) }
+
+ it 'returns parents members' do
+ expect(group.members_with_parents).to include(developer)
+ expect(group.members_with_parents).to include(master)
+ end
+ end
end